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

azure部署的deepseek无法使用 #2047

Open
5 tasks done
funnycups opened this issue Jan 30, 2025 · 0 comments
Open
5 tasks done

azure部署的deepseek无法使用 #2047

funnycups opened this issue Jan 30, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@funnycups
Copy link

例行检查

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

问题描述
azure部署的deepseek属于serverless服务,接口应该是兼容openai格式的,在关闭了跨域限制的chrome上使用nextchat可以直接聊天。

然而,在one api上配置azure的deepseek接口后,点击测试会显示接口可用,但实际发送聊天消息时会返回400 Invalid HTTP request received
复现步骤
接入azure的deepseek接口
发起聊天完成请求

curl http://127.0.0.1:3000/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer xxxx"   -d '{
    "messages": [{"role": "user", "content": "你好!"}],
    "stream": false,
    "model": "deepseek-deployment-name",
    "temperature": 0.5,
    "presence_penalty": 0,
    "frequency_penalty": 0,
    "top_p": 1
  }'

提示

{"error":{"message":"Invalid HTTP request received. (request id: xxxx)","type":"","param":"","code":"Bad Request"}}

如果我把上面的请求改成azure的接口和key,并再次请求,可以得到聊天返回的结果

{"choices":[{"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}},"finish_reason":"stop","index":0,"message":{"content":"\u003cthink\u003e\n\n\u003c/think\u003e\n\n你好!很高兴见到你,有什么我可以帮 忙的吗?无论是聊天、解答问题还是提供建议,我都在这里哦!😊","role":"assistant","tool_calls":[]}}],"created":1738222572,"id":"chatcmpl-xxxx","model":"DeepSeek-R1","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"usage":{"completion_tokens":32,"prompt_tokens":5,"prompt_tokens_details":null,"total_tokens":37}}

预期结果
正确处理请求

@funnycups funnycups added the bug Something isn't working label Jan 30, 2025
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

No branches or pull requests

1 participant