mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-12-14 15:48:15 +00:00
feat(models-types): update to use Message
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import z from 'zod';
|
import z from 'zod';
|
||||||
import { ChatTurnMessage } from '../types';
|
import { Message } from '../types';
|
||||||
|
|
||||||
type Model = {
|
type Model = {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -44,13 +44,13 @@ type Tool = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type ToolCall = {
|
type ToolCall = {
|
||||||
id?: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
arguments: Record<string, any>;
|
arguments: Record<string, any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type GenerateTextInput = {
|
type GenerateTextInput = {
|
||||||
messages: ChatTurnMessage[];
|
messages: Message[];
|
||||||
tools?: Tool[];
|
tools?: Tool[];
|
||||||
options?: GenerateOptions;
|
options?: GenerateOptions;
|
||||||
};
|
};
|
||||||
@@ -63,14 +63,14 @@ type GenerateTextOutput = {
|
|||||||
|
|
||||||
type StreamTextOutput = {
|
type StreamTextOutput = {
|
||||||
contentChunk: string;
|
contentChunk: string;
|
||||||
toolCallChunk: Partial<ToolCall>[];
|
toolCallChunk: ToolCall[];
|
||||||
additionalInfo?: Record<string, any>;
|
additionalInfo?: Record<string, any>;
|
||||||
done?: boolean;
|
done?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type GenerateObjectInput = {
|
type GenerateObjectInput = {
|
||||||
schema: z.ZodTypeAny;
|
schema: z.ZodTypeAny;
|
||||||
messages: ChatTurnMessage[];
|
messages: Message[];
|
||||||
options?: GenerateOptions;
|
options?: GenerateOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user