Skip to content

Adds reasoning support across all providers and improves Ollama stream options#23

Merged
carmelosantana merged 2 commits intomainfrom
chore_ollama-stream-options
Mar 17, 2026
Merged

Adds reasoning support across all providers and improves Ollama stream options#23
carmelosantana merged 2 commits intomainfrom
chore_ollama-stream-options

Conversation

@carmelosantana
Copy link
Copy Markdown
Owner

Enhances provider compatibility by adding reasoning (thinking) content extraction and streaming support for:

  • Anthropic models with extended thinking blocks
  • Gemini models with thought parts
  • Mistral models with Magistral array content format
  • Ollama models with improved token reporting via stream_options
  • OpenAI-compatible providers with thinking field handling

Key improvements:

  • Streaming responses now yield separate reasoning chunks for better agent interaction
  • All providers properly parse and expose reasoning content from model outputs
  • Ollama stream_options now includes usage reporting for better token tracking

Enables extraction and streaming of reasoning content from various model responses, including extended thinking blocks and thought parts. Updates Response objects to include a new reasoning field for better transparency into model decision-making processes.
Allow stream_options.include_usage to be sent in Ollama payloads for token usage reporting.
@carmelosantana carmelosantana merged commit 9abb950 into main Mar 17, 2026
4 checks passed
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