From da79e987f0ac0a4986bf396f043b36ef840370bc Mon Sep 17 00:00:00 2001 From: Parth Sareen Date: Thu, 21 Aug 2025 13:44:59 -0700 Subject: [PATCH] examples: fix gpt-oss-tools-stream for adding toolcalls (#568) --- examples/gpt-oss-tools-stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gpt-oss-tools-stream.py b/examples/gpt-oss-tools-stream.py index 8d0a27f..1becdd7 100644 --- a/examples/gpt-oss-tools-stream.py +++ b/examples/gpt-oss-tools-stream.py @@ -55,7 +55,7 @@ client = Client( # 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 @@ -81,7 +81,7 @@ while True: 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()