File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,12 @@ async def handle_stream(
150150 )
151151
152152 if reasoning_content and state .reasoning_content_index_and_output :
153+ # Ensure summary list has at least one element
154+ if not state .reasoning_content_index_and_output [1 ].summary :
155+ state .reasoning_content_index_and_output [1 ].summary = [
156+ Summary (text = "" , type = "summary_text" )
157+ ]
158+
153159 yield ResponseReasoningSummaryTextDeltaEvent (
154160 delta = reasoning_content ,
155161 item_id = FAKE_RESPONSES_ID ,
@@ -201,7 +207,7 @@ async def handle_stream(
201207 )
202208
203209 # Create a new summary with updated text
204- if state .reasoning_content_index_and_output [1 ].content is None :
210+ if not state .reasoning_content_index_and_output [1 ].content :
205211 state .reasoning_content_index_and_output [1 ].content = [
206212 Content (text = "" , type = "reasoning_text" )
207213 ]
You can’t perform that action at this time.
0 commit comments