feat(models-types): update to use Message

This commit is contained in:
ItzCrazyKns
2025-12-06 15:25:15 +05:30
parent 574b3d55e2
commit e99c8bdd50

View File

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