diff --git a/examples/gpt-oss-tools-stream.py b/examples/gpt-oss-tools-stream.py index 1becdd78..97be624e 100644 --- a/examples/gpt-oss-tools-stream.py +++ b/examples/gpt-oss-tools-stream.py @@ -98,6 +98,7 @@ def get_weather_conditions(city: str) -> str: messages.append(result_message) else: print(f'Tool {tool_call.function.name} not found') + messages.append({'role': 'tool', 'content': f'Tool {tool_call.function.name} not found', 'tool_name': tool_call.function.name}) else: # no more tool calls, we can stop the loop diff --git a/examples/gpt-oss-tools.py b/examples/gpt-oss-tools.py index b2502271..d4a20f7f 100644 --- a/examples/gpt-oss-tools.py +++ b/examples/gpt-oss-tools.py @@ -78,7 +78,7 @@ def get_weather_conditions(city: str) -> str: messages.append({'role': 'tool', 'content': result, 'tool_name': tool_call.function.name}) else: print(f'Tool {tool_call.function.name} not found') - + messages.append({'role': 'tool', 'content': f'Tool {tool_call.function.name} not found', 'tool_name': tool_call.function.name}) else: # no more tool calls, we can stop the loop break