fix: handle reasoning content blocks in OpenAI-compat streaming parser (#8078)

This commit is contained in:
Will Pfleger
2026-03-23 17:35:46 -04:00
committed by GitHub
parent 2ff4ab27ee
commit ce160b183d
+3 -2
View File
@@ -58,7 +58,8 @@ enum DeltaContent {
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
struct ContentPart { struct ContentPart {
r#type: String, r#type: String,
text: String, #[serde(default)]
text: Option<String>,
#[serde(rename = "thoughtSignature")] #[serde(rename = "thoughtSignature")]
thought_signature: Option<String>, thought_signature: Option<String>,
} }
@@ -100,7 +101,7 @@ fn extract_content_and_signature(
let text = text_parts let text = text_parts
.iter() .iter()
.map(|p| p.text.as_str()) .filter_map(|p| p.text.as_deref())
.collect::<String>(); .collect::<String>();
let signature = text_parts let signature = text_parts