Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/gpt-oss-tools-stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_weather_conditions(city: str) -> str:
# host="https://ollama.com", headers={'Authorization': (os.getenv('OLLAMA_API_KEY'))}
)

model = 'gpt-oss:120b'
model = 'gpt-oss:20b'
# gpt-oss can call tools while "thinking"
# a loop is needed to call the tools and get the results
final = True
Expand All @@ -81,7 +81,7 @@ def get_weather_conditions(city: str) -> str:
thinking += chunk.message.thinking
print(chunk.message.thinking, end='', flush=True)

if thinking != '' or content != '':
if thinking != '' or content != '' or len(tool_calls) > 0:
messages.append({'role': 'assistant', 'thinking': thinking, 'content': content, 'tool_calls': tool_calls})

print()
Expand Down
Loading