Add tool type to chat completion requests

This commit is contained in:
Akarshan 2025-06-23 16:32:26 +05:30 committed by Louis
parent 8bd4a3389f
commit 7f25311d26
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -22,10 +22,26 @@ export interface InputAudio {
format: 'mp3' | 'wav' | 'ogg' | 'flac' // Add more formats as needed/llama-server seems to support mp3 format: 'mp3' | 'wav' | 'ogg' | 'flac' // Add more formats as needed/llama-server seems to support mp3
} }
export interface chatCompletionRequest { export interface ToolFunction {
model: string // Model ID, though for local it might be implicit via sessionInfo name: string; // Required: a-z, A-Z, 0-9, _, - (max length: 64)
messages: chatCompletionRequestMessage[] description?: string; // Optional
parameters?: Record<string, unknown>; // Optional: JSON Schema object
strict?: boolean | null; // Optional: defaults to false
type: 'function'
}
export interface ToolCall {
function: ToolFunction;
}
export interface ToolDefinition {
tools?: ToolCall[];
}
export interface chatCompletionRequest {
model: string; // Model ID, though for local it might be implicit via sessionInfo
messages: chatCompletionRequestMessage[];
tools?: ToolFunction[];
// Core sampling parameters // Core sampling parameters
temperature?: number | null temperature?: number | null
dynatemp_range?: number | null dynatemp_range?: number | null