From ee5d9172a422c469e607f7bcfd3484344c5ec3eb Mon Sep 17 00:00:00 2001 From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com> Date: Fri, 5 Dec 2025 21:16:41 +0530 Subject: [PATCH] feat(models): add tool, tool call --- src/lib/models/types.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lib/models/types.ts b/src/lib/models/types.ts index 45560d1..54c3e1e 100644 --- a/src/lib/models/types.ts +++ b/src/lib/models/types.ts @@ -37,18 +37,33 @@ type GenerateOptions = { presencePenalty?: number; }; +type Tool = { + name: string; + description: string; + schema: z.ZodObject; +}; + +type ToolCall = { + id?: string; + name: string; + arguments: Record; +}; + type GenerateTextInput = { messages: ChatTurnMessage[]; + tools?: Tool[]; options?: GenerateOptions; }; type GenerateTextOutput = { content: string; + toolCalls: ToolCall[]; additionalInfo?: Record; }; type StreamTextOutput = { contentChunk: string; + toolCallChunk: Partial[]; additionalInfo?: Record; done?: boolean; }; @@ -83,4 +98,6 @@ export type { GenerateObjectInput, GenerateObjectOutput, StreamObjectOutput, + Tool, + ToolCall, };