mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #773] [Bug] /v1/chat/completions不支持content数组格式 #560
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#560
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lonchura on GitHub (Mar 3, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/773
检查清单
问题描述
POST /v1/chat/completions
{ "model": "deepseek-r1", "messages": [{ "role": "system", "content": "You are Cline, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices." }, { "role": "user", "content": [{ "type": "text", "text": "\n你是谁\n" }, { "type": "text", "text": "\n# VSCode Visible Files\n(No visible files)\n\n# VSCode Open Tabs\n(No open tabs)\n\n# Current Time\n2025/3/3 下午2:43:41 (Asia/Shanghai, UTC+8:00)\n\n# Current Working Directory (/Volumes/Work/workspace/open-evol) Files\nai prop f(x).py\nai_percentage_plot.png\nindex.html\nplot_function.py\n\n# Current Mode\nACT MODE\n" }] }], "temperature": 0, "stream": true, "stream_options": { "include_usage": true } }返回如下结果,看着像是与openai chat completions协议不完全兼容,不支持content的array格式
{ "detail": [ { "type": "string_type", "loc": [ "body", "messages", 1, "content" ], "msg": "Input should be a valid string", "input": [ { "type": "text", "text": "\n你是谁\n" }, { "type": "text", "text": "\n# VSCode Visible Files\n(No visible files)\n\n# VSCode Open Tabs\n(No open tabs)\n\n# Current Time\n2025/3/3 下午2:43:41 (Asia/Shanghai, UTC+8:00)\n\n# Current Working Directory (/Volumes/Work/workspace/open-evol) Files\nai prop f(x).py\nai_percentage_plot.png\nindex.html\nplot_function.py\n\n# Current Mode\nACT MODE\n" } ] } ] }复现步骤
执行如下命令进行复现
curl --location 'http://server-ip:10002/v1/chat/completions' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'user-agent: Ba/JS 4.83.0' \ --header 'x-stainless-lang: js' \ --header 'x-stainless-package-version: 4.83.0' \ --header 'x-stainless-os: MacOS' \ --header 'x-stainless-arch: x64' \ --header 'x-stainless-runtime: node' \ --header 'x-stainless-runtime-version: v20.18.1' \ --header 'authorization: Bearer sk-UV3HUPDlLELeGvzl2cF7169c334d432482B254679c9e0f83' \ --header 'x-stainless-retry-count: 0' \ --header 'x-stainless-timeout: 600000' \ --data '{ "model": "deepseek-r1", "messages": [{ "role": "system", "content": "You are Cline, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices." }, { "role": "user", "content": [{ "type": "text", "text": "\n你是谁\n" }, { "type": "text", "text": "\n# VSCode Visible Files\n(No visible files)\n\n# VSCode Open Tabs\n(No open tabs)\n\n# Current Time\n2025/3/3 下午2:43:41 (Asia/Shanghai, UTC+8:00)\n\n# Current Working Directory (/Volumes/Work/workspace/open-evol) Files\nai prop f(x).py\nai_percentage_plot.png\nindex.html\nplot_function.py\n\n# Current Mode\nACT MODE\n" }] }], "temperature": 0, "stream": true, "stream_options": { "include_usage": true } }'环境信息
v0.2.2rc2
@qiyuxinlin commented on GitHub (Mar 3, 2025):
Yes, we have not implemented the content array format interface. OpenAI's content array is for users to include text, pictures, audio and other information in one request. However, our current framework can only obtain text information, so there is no need to make an array interface.
@ErvinXie commented on GitHub (Dec 11, 2025):
This issue has been automatically closed due to inactivity for 60 days.
If you believe this issue is still relevant, please feel free to reopen it with additional information or context.
Thank you for your contribution to KTransformers!
此 issue 因超过 60 天无活动而被自动关闭。
如果您认为此问题仍然存在,请随时重新打开并提供更多信息或上下文。
感谢您对 KTransformers 的贡献!