@@ -208,7 +208,7 @@ pub(crate) async fn stream_chat_completions(
208208 && let Some ( reasoning) = reasoning_by_anchor_index. get ( & idx)
209209 && let Some ( obj) = msg. as_object_mut ( )
210210 {
211- obj. insert ( "reasoning " . to_string ( ) , json ! ( reasoning) ) ;
211+ obj. insert ( "reasoning_content " . to_string ( ) , json ! ( reasoning) ) ;
212212 }
213213 messages. push ( msg) ;
214214 }
@@ -233,7 +233,7 @@ pub(crate) async fn stream_chat_completions(
233233 if let Some ( reasoning) = reasoning_by_anchor_index. get ( & idx)
234234 && let Some ( obj) = msg. as_object_mut ( )
235235 {
236- obj. insert ( "reasoning " . to_string ( ) , json ! ( reasoning) ) ;
236+ obj. insert ( "reasoning_content " . to_string ( ) , json ! ( reasoning) ) ;
237237 }
238238 messages. push ( msg) ;
239239 }
@@ -257,7 +257,7 @@ pub(crate) async fn stream_chat_completions(
257257 if let Some ( reasoning) = reasoning_by_anchor_index. get ( & idx)
258258 && let Some ( obj) = msg. as_object_mut ( )
259259 {
260- obj. insert ( "reasoning " . to_string ( ) , json ! ( reasoning) ) ;
260+ obj. insert ( "reasoning_content " . to_string ( ) , json ! ( reasoning) ) ;
261261 }
262262 messages. push ( msg) ;
263263 }
@@ -593,7 +593,7 @@ async fn process_chat_sse<S>(
593593 // Forward any reasoning/thinking deltas if present.
594594 // Some providers stream `reasoning` as a plain string while others
595595 // nest the text under an object (e.g. `{ "reasoning": { "text": "…" } }`).
596- if let Some ( reasoning_val) = choice. get ( "delta" ) . and_then ( |d| d. get ( "reasoning " ) ) {
596+ if let Some ( reasoning_val) = choice. get ( "delta" ) . and_then ( |d| d. get ( "reasoning_content " ) ) {
597597 let mut maybe_text = reasoning_val
598598 . as_str ( )
599599 . map ( str:: to_string)
@@ -622,7 +622,7 @@ async fn process_chat_sse<S>(
622622 }
623623
624624 // Some providers only include reasoning on the final message object.
625- if let Some ( message_reasoning) = choice. get ( "message" ) . and_then ( |m| m. get ( "reasoning " ) )
625+ if let Some ( message_reasoning) = choice. get ( "message" ) . and_then ( |m| m. get ( "reasoning_content " ) )
626626 {
627627 // Accept either a plain string or an object with { text | content }
628628 if let Some ( s) = message_reasoning. as_str ( ) {
0 commit comments