Watch
1
0
Fork
You've already forked souveraine
0

parse reasoning_content alias (deepseek/z.ai reasoning field name)

This commit is contained in:
Fimeg 2026-07-16 13:03:51 -04:00
commit b4dc39e501

View file

@ -248,7 +248,8 @@ pub struct ResponseMessage {
pub role: String,
#[serde(default)]
pub content: Option<String>,
#[serde(default)]
// OpenRouter says "reasoning"; DeepSeek and z.ai say "reasoning_content".
#[serde(default, alias = "reasoning_content")]
pub reasoning: Option<String>,
#[serde(default)]
pub tool_calls: Option<Vec<ToolCall>>,
@ -294,7 +295,8 @@ pub struct StreamChoice {
pub struct Delta {
#[serde(default)]
pub content: Option<String>,
#[serde(default)]
// OpenRouter says "reasoning"; DeepSeek and z.ai say "reasoning_content".
#[serde(default, alias = "reasoning_content")]
pub reasoning: Option<String>,
#[serde(default)]
pub role: Option<String>,