* 使用 Qwen 的 Function Call 功能
(messages: any[], toolsOrFunctions: any[], options?: any)
| 247 | * 使用 Qwen 的 Function Call 功能 |
| 248 | */ |
| 249 | public async functionCall(messages: any[], toolsOrFunctions: any[], options?: any): Promise<any> { |
| 250 | this.ensureLLMAvailable(); |
| 251 | |
| 252 | if (this.llm instanceof QwenLLM) { |
| 253 | // 使用智能格式选择 |
| 254 | return await this.llm.smartFunctionCall(messages, toolsOrFunctions, options); |
| 255 | } else { |
| 256 | throw new Error('Function call 仅支持 Qwen 模型'); |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * 解析工具调用结果 |
nothing calls this directly
no test coverage detected