mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
fix(openai): support "reasoning" field alias in streaming deltas (#7294)
Signed-off-by: rabi <ramishra@redhat.com>
This commit is contained in:
@@ -53,6 +53,7 @@ struct Delta {
|
||||
role: Option<String>,
|
||||
tool_calls: Option<Vec<DeltaToolCall>>,
|
||||
reasoning_details: Option<Vec<Value>>,
|
||||
#[serde(alias = "reasoning")]
|
||||
reasoning_content: Option<String>,
|
||||
}
|
||||
|
||||
@@ -338,8 +339,11 @@ pub fn response_to_message(response: &Value) -> anyhow::Result<Message> {
|
||||
|
||||
let mut content = Vec::new();
|
||||
|
||||
// Capture reasoning_content if present (for DeepSeek reasoning models)
|
||||
if let Some(reasoning_content) = original.get("reasoning_content") {
|
||||
// Capture reasoning content if present (DeepSeek uses "reasoning_content", vLLM uses "reasoning")
|
||||
let reasoning_value = original
|
||||
.get("reasoning_content")
|
||||
.or_else(|| original.get("reasoning"));
|
||||
if let Some(reasoning_content) = reasoning_value {
|
||||
if let Some(reasoning_str) = reasoning_content.as_str() {
|
||||
if !reasoning_str.is_empty() {
|
||||
content.push(MessageContent::reasoning(reasoning_str));
|
||||
|
||||
Reference in New Issue
Block a user