Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用讯飞星火Spark Pro/Max Function Call 不能按预期返回 Function Call 形式的结果,只会返回普通对话形式的结果 #1543

Closed
5 tasks done
shijilin0116 opened this issue Jun 20, 2024 · 0 comments · Fixed by #1544
Labels
bug Something isn't working

Comments

@shijilin0116
Copy link
Contributor

shijilin0116 commented Jun 20, 2024

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,尤其是常见问题部分
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述
#1526 修复了 Spark Lite/Spark Pro/Max 函数调用有报错的问题。但是,按照目前的代码,Spark Pro/Max 虽然不会报错,但也不会返回函数调用格式的回答,而是返回普通对话的回答。
复现步骤
按照openai的标准使用以下请求体发起请求,得到的结果是普通对话回答,而不是 Function Call形式的回答。

{
  "model": "SparkDesk",
  "messages": [
    {
      "role": "user",
      "content": "What's the weather like in Boston today?"
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_current_weather",
        "description": "Get the current weather in a given location",
        "parameters": {
          "type": "object",
          "properties": {
            "location": {
              "type": "string",
              "description": "The city and state, e.g. San Francisco, CA"
            },
            "unit": {
              "type": "string",
              "enum": [
                "celsius",
                "fahrenheit"
              ]
            }
          },
          "required": [
            "location"
          ]
        }
      }
    }
  ],
  "tool_choice": "auto"
}

预期结果
调用Spark Pro/Max 的 Function Call 应该能够返回正确的函数调用的结果。
相关截图
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant