Skip to content

fix: fix format_response for better API response handling#365

Merged
scuuy merged 1 commit intoOpenDCAI:mainfrom
CheinTian:fix-format-when-reasoning-content-is-null
Nov 12, 2025
Merged

fix: fix format_response for better API response handling#365
scuuy merged 1 commit intoOpenDCAI:mainfrom
CheinTian:fix-format-when-reasoning-content-is-null

Conversation

@CheinTian
Copy link
Contributor

fix format_response method to improve handling of API responses, including embedding and reasoning content.

fix format_response method to improve handling of API responses, including embedding and reasoning content.
@CheinTian
Copy link
Contributor Author

makes format more robust. when reasoning_content is null, do not add <think></think> label.

Here is a example:

{ "index": 0, "message": { "role": "assistant", "content": "你好,我是DeepSeek,一个由深度求索公司创造的AI助手,很高兴为你提供帮助!😊", "refusal": null, "annotations": null, "audio": null, "function_call": null, "tool_calls": [], "reasoning_content": null }, "logprobs": null, "finish_reason": "stop", "stop_reason": null, "token_ids": null }

old version add label when reasoning_content is null. we don't want it.

@scuuy
Copy link
Contributor

scuuy commented Nov 12, 2025

Thanks for this code part😊, it indeed becomes more robust without changing the former usage. We will merge it.

@scuuy scuuy merged commit a538dfc into OpenDCAI:main Nov 12, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments