fix: handle reasoning content blocks in OpenAI-compat streaming parser (#8078)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user