feat: return reasoning_content with tool_calls for DeepSeek models (#2543)

* feat: return reasoning_content with tool_calls for DeepSeek models

* fix: correct reasoning_content handling for DeepSeek tool_calls

* test: cover DeepSeek reasoning content round trip

---------

Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
bling-yshs
2026-05-07 23:03:07 +08:00
committed by GitHub
parent 1d44b1ba41
commit f5fbcd0493
3 changed files with 104 additions and 8 deletions
+3 -2
View File
@@ -33,8 +33,9 @@ struct StreamChoice {
struct Delta {
#[serde(default)]
content: Option<String>,
#[serde(default)]
reasoning: Option<String>, // OpenRouter 的推理内容
// OpenRouter/Kimi/其它 使用 reasoningDeepSeek 使用 reasoning_content
#[serde(default, alias = "reasoning_content")]
reasoning: Option<String>,
#[serde(default)]
tool_calls: Option<Vec<DeltaToolCall>>,
}