Skip to content

add kStreamEventTypeReasoningDelta type and "reasoning_content" handler so reasoning_content creates a StreamEvent - #60

Open
tv1wnd wants to merge 2 commits into
ClickHouse:mainfrom
tv1wnd:main
Open

tv1wnd wants to merge 2 commits into
ClickHouse:mainfrom
tv1wnd:main

Conversation

@tv1wnd

@tv1wnd tv1wnd commented Nov 16, 2026

Copy link
Copy Markdown

issue:

using a custom OpenAI API endpoint with long reasoning will result in a "Timeout waiting for next event" after 30s ( hard coded kEventTimeout ), since reasoning creates no StreamEvent

(incomplete) fix:

added StreamEventType::kStreamEventTypeReasoningDelta enum
OpenAIStreamImpl::process_sse_line() now handles "reasoning_content" and produces a StreamEvent() ( without content )

why no content?

would require changing the StreamEvent() constructor
currently StreamEvent(StreamEventType, std::string) feeds error only

struct StreamEvent {
  explicit StreamEvent(std::string text)
      : type(kStreamEventTypeTextDelta), text_delta(std::move(text)) {}

  StreamEvent(StreamEventType event_type, std::string error_msg)
      : type(event_type), error(std::move(error_msg)) {}
      


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