You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Semantic Kernel调用本地插件时触发HttpOperationException错误

问题:SemanticKernel自动调用插件时抛出HttpOperationException错误

在LinqPad脚本中参照微软官方示例开发本地原生插件,直接调用MathPlugin的Sqrt方法时运行正常:

double resultDirect = await kernel.InvokeAsync<double>(
    nameof(Plugins.MathPlugin), nameof(Plugins.MathPlugin.Sqrt),
    new()
    {
        {"number1", 12 },
    })!;

resultDirect.Dump();

但按照「让AI自动调用函数」的步骤操作时,执行await foreach (var content in result)抛出Microsoft.SemanticKernel.HttpOperationException,错误信息为:

Unrecognized request arguments supplied: tool_choice, tools
Status: 400 (model_error)

错误详情的JSON内容:

{
  "error": {
    "message": "Unrecognized request arguments supplied: tool_choice, tools",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

使用的NuGet包版本:

  • Microsoft.SemanticKernel 1.1.0
  • Microsoft.SemanticKernel.Plugins.Core(pre) 1.1.0-alpha
  • Microsoft.SemanticKernel.Planners.Handlebars(pre) 1.1.0-preview

内容的提问来源于stack exchange,提问作者DrGriff

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 07:37:33