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