Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
export interface ToolSchema {
name: string;
description: string;
parameters: Record<string, unknown>; // JSON Schema
}
export interface ToolCall {
id: string;
name: string;
args: Record<string, unknown>;
}
export type Msg =
| { role: 'system'; content: string }
| { role: 'user'; content: string }
| { role: 'assistant'; content: string | null; toolCalls?: ToolCall[] }
| { role: 'tool'; toolCallId: string; content: string };
export interface Turn {
text: string | null;
toolCalls: ToolCall[];
usage: { inputTokens: number; outputTokens: number };
}
export interface ChatOpts {
maxTokens?: number;
}
export interface Provider {
readonly name: string;
chat(messages: Msg[], tools: ToolSchema[], opts?: ChatOpts): Promise<Turn>;
close?(): Promise<void>;
}
b97977475This file is pinned to the selected release. Download the original to open it in your design tool.