import type { ChatCompletionFunctionTool } from "../types/tool.js"; export interface ChatCompletionsCallOptions { gatewayConfig: { apiKey?: string; baseURL?: string; defaultHeaders?: Record; extraBody?: Record; }; modelConfig: Record; messages: Array<{ role: string; content: string; tool_call_id?: string; tool_calls?: Array<{ id: string; type: "function"; function: { name: string; arguments: string; }; }>; }>; systemPrompt?: string; tools?: ChatCompletionFunctionTool[]; abortSignal?: AbortSignal; toolChoice?: "auto" | "none" | "required" | { type: "function"; function: { name: string; }; }; maxTokens?: number; model?: string; /** 采样温度覆盖。子任务(title/predict/goal-eval/structured-output)用 0.1 降低随机性。 */ temperature?: number; /** top_p 覆盖。 */ topP?: number; } export interface ChatCompletionsCallResult { content?: string; tool_calls?: Array<{ id: string; type: "function"; function: { name: string; arguments: string; }; }>; reasoning_content?: string; finish_reason?: "stop" | "length" | "tool_calls" | "content_filter" | null; } export type ChatCompletionsStreamEvent = { type: "text-delta"; text: string; } | { type: "reasoning-delta"; text: string; } | { type: "tool-call-delta"; toolCallId: string; toolName: string; argsChunk: string; accumulatedArgs: string; } | { type: "tool-call-start"; toolCallId: string; toolName: string; args: string; } | { type: "finish"; finishReason: string; usage?: { inputTokens: number; outputTokens: number; totalTokens: number; }; } | { type: "error"; error: string; }; export declare function callAgentStream(options: ChatCompletionsCallOptions): AsyncGenerator; export declare function callAgent(options: ChatCompletionsCallOptions): Promise;