File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -214,11 +214,17 @@ async def handle_assistant_stream(
214
214
215
215
# Handle code interpreter tool calls
216
216
elif tool_call .type == "code_interpreter" :
217
- if tool_call .code_interpreter and tool_call .code_interpreter .input :
218
- yield sse_format (
219
- "toolDelta" ,
220
- wrap_for_oob_swap (step_id , str (tool_call .code_interpreter .input ))
221
- )
217
+ if tool_call .code_interpreter and tool_call .code_interpreter .input is not None :
218
+ if tool_call .code_interpreter .input == "" :
219
+ yield sse_format (
220
+ "toolDelta" ,
221
+ wrap_for_oob_swap (step_id , "<em>Code Interpreter tool call</em><br>" )
222
+ )
223
+ else :
224
+ yield sse_format (
225
+ "toolDelta" ,
226
+ wrap_for_oob_swap (step_id , str (tool_call .code_interpreter .input ))
227
+ )
222
228
if tool_call .code_interpreter and tool_call .code_interpreter .outputs :
223
229
for output in tool_call .code_interpreter .outputs :
224
230
if output .type == "logs" and output .logs :
You can’t perform that action at this time.
0 commit comments