This commit is contained in:
Timothy Jaeryang Baek
2026-04-12 17:22:06 -05:00
parent 4498e6faf2
commit c47dd7b771
7 changed files with 182 additions and 36 deletions
+3 -2
View File
@@ -4060,11 +4060,12 @@ async def streaming_chat_response_handler(response, ctx):
if responses_api_tool_calls:
tool_calls.append(_split_tool_calls(responses_api_tool_calls))
try:
await stream_body_handler(response, form_data)
finally:
if response.background:
await response.background()
await stream_body_handler(response, form_data)
tool_call_retries = 0
tool_call_sources = [] # Track citation sources from tool results
all_tool_call_sources = [] # Accumulated sources across all iterations