mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-12-14 15:48:15 +00:00
feat(models): add tool, tool call
This commit is contained in:
@@ -37,18 +37,33 @@ type GenerateOptions = {
|
|||||||
presencePenalty?: number;
|
presencePenalty?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type Tool = {
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
schema: z.ZodObject<any>;
|
||||||
|
};
|
||||||
|
|
||||||
|
type ToolCall = {
|
||||||
|
id?: string;
|
||||||
|
name: string;
|
||||||
|
arguments: Record<string, any>;
|
||||||
|
};
|
||||||
|
|
||||||
type GenerateTextInput = {
|
type GenerateTextInput = {
|
||||||
messages: ChatTurnMessage[];
|
messages: ChatTurnMessage[];
|
||||||
|
tools?: Tool[];
|
||||||
options?: GenerateOptions;
|
options?: GenerateOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
type GenerateTextOutput = {
|
type GenerateTextOutput = {
|
||||||
content: string;
|
content: string;
|
||||||
|
toolCalls: ToolCall[];
|
||||||
additionalInfo?: Record<string, any>;
|
additionalInfo?: Record<string, any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type StreamTextOutput = {
|
type StreamTextOutput = {
|
||||||
contentChunk: string;
|
contentChunk: string;
|
||||||
|
toolCallChunk: Partial<ToolCall>[];
|
||||||
additionalInfo?: Record<string, any>;
|
additionalInfo?: Record<string, any>;
|
||||||
done?: boolean;
|
done?: boolean;
|
||||||
};
|
};
|
||||||
@@ -83,4 +98,6 @@ export type {
|
|||||||
GenerateObjectInput,
|
GenerateObjectInput,
|
||||||
GenerateObjectOutput,
|
GenerateObjectOutput,
|
||||||
StreamObjectOutput,
|
StreamObjectOutput,
|
||||||
|
Tool,
|
||||||
|
ToolCall,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user