songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
16.06k stars 3.73k forks source link

星火工具调用失败(响应阶段) #1570

Open c121914yu opened 6 days ago

c121914yu commented 6 days ago

例行检查

问题描述 星火使用 tool 调用时候失败,可以返回参数,但是利用工具响应发起请求时,会报错。 image

测试请求体: model

{
  "model": "SparkDesk-v3.5,
  "temperature": 0,
  "stream": false,
  "messages": [
    {
      "role": "user",
      "content": "几点了"
    },
    {
      "role": "assistant",
      "tool_calls": [
        {
          "id": "call_23f1a7ad8104455db939b812611fa560",
          "type": "function",
          "function": {
            "name": "nYGo9W",
            "arguments": ""
          }
        }
      ]
    },
    {
      "tool_call_id": "call_23f1a7ad8104455db939b812611fa560",
      "role": "tool",
      "name": "nYGo9W",
      "content": "{\n  \"time\": \"2024-06-27 11:20:45 Thursday\"\n}"
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "nYGo9W",
        "description": "获取用户当前时区的时间。",
        "parameters": {
          "type": "object",
          "properties": {},
          "required": []
        }
      }
    }
  ],
  "tool_choice": "auto"
}