v1.17.0
✨ Reasoning Content Support
This release adds first-class support for reasoning chunks streamed by modern reasoning-capable models (e.g. GPT-5 family such as gpt-5.4-mini and gpt-5, or Claude Opus 4.6 via compatible gateways). Reasoning output is forwarded to clients automatically — no pipeline wrapper changes required — and Open WebUI renders it as collapsible "Thinking" blocks out of the box.
Automatic Reasoning Streaming
Both the Chat Completions (/v1/chat/completions) and Responses API (/v1/responses) endpoints now handle StreamingChunk objects that carry a reasoning field:
- Chat Completions: reasoning tokens are emitted as
reasoning_contenton the message delta, following the DeepSeek convention — compatible with Open WebUI and other clients. - Responses API: reasoning tokens are emitted as
response.reasoning_summary_text.delta/response.reasoning_summary_text.doneSSE events, producingtype: "reasoning"output items with asummaryarray (matching the OpenAI spec).
on_reasoning Callback
A new on_reasoning callback for streaming_generator / async_streaming_generator lets pipeline wrappers intercept reasoning chunks — similar to the existing on_tool_call_start / on_tool_call_end hooks:
from typing import Any
from hayhooks import PipelineEvent, streaming_generator
def on_reasoning(
text: str,
extra: dict[str, Any] | None,
) -> PipelineEvent | str | None | list[PipelineEvent | str]:
return text
def run_chat_completion(self, model, messages, body):
return streaming_generator(
pipeline=self.pipeline,
pipeline_run_args={"messages": messages},
on_reasoning=on_reasoning,
)/run Endpoint Reasoning Fallback
When a StreamingChunk has empty content but carries reasoning, the /run streaming endpoint now forwards the reasoning text instead of emitting an empty string.
📦 Dependency Updates
- Bumped
fastapi-openai-compatfrom>=1.1.0to>=1.2.0to pick up reasoning content support in the OpenAI-compatible layer.
📚 Documentation
- New Reasoning Content sections in the OpenAI Compatibility and Open WebUI Integration pages.
- New Reasoning Content Callback section in the Pipeline Wrapper concept page.
- Updated Agent Deployment docs with a pointer to the new reasoning agent example.
🆕 New Example
reasoning_agent— a minimal Open WebUI–ready pipeline wrapper usingOpenAIResponsesChatGeneratorwithgpt-5.4-mini, showing how reasoning summaries are streamed to the UI.
What's Changed
- Add reasoning chunks support (#235) by @mpangrazzi
Full Changelog: v1.16.0...v1.17.0