Skip to content

Conversation

szaman19
Copy link

@szaman19 szaman19 commented Oct 12, 2025

Enables models to store thinking tokens from model clients

Problem

The BaseAgent and AssistantAgent clients using Ollama OllamaChatCompletionClient don't report thinking tokens when using run(task). Only the content field of the tool call is checked for thought, but ollama may also return the thinking tokens in the thinking field. This PR updates the check in the _ollama_client to also check the thinking field.

As a result:

result = await agent.task()

print(result.thinking)  # This is maybe empty even with a reasoning model 

Changes

  • python/packages/autogen-ext/src/autogen_ext/models/ollama/_ollama_client.py - Lines 678-679

Checks

Enables models to store thinking tokens from model clients
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant