feat(models): add tool, tool call

This commit is contained in:
ItzCrazyKns
2025-12-05 21:16:41 +05:30
parent c35b684dc5
commit ee5d9172a4

View File

@@ -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,
};