Skip to content

v1.17.0

Choose a tag to compare

@mpangrazzi mpangrazzi released this 16 Apr 10:12
9d8e8b3

✨ 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_content on 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.done SSE events, producing type: "reasoning" output items with a summary array (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-compat from >=1.1.0 to >=1.2.0 to pick up reasoning content support in the OpenAI-compatible layer.

📚 Documentation

🆕 New Example

  • reasoning_agent — a minimal Open WebUI–ready pipeline wrapper using OpenAIResponsesChatGenerator with gpt-5.4-mini, showing how reasoning summaries are streamed to the UI.

What's Changed

Full Changelog: v1.16.0...v1.17.0