Class: LLM::Stream::Disabled

Inherits:
LLM::Stream show all
Defined in:
lib/llm/stream/disabled.rb

Overview

An LLM::Stream::Disabled represents a stream that is explicitly turned off.

try returns an instance of this class when given false or nil. Providers check #enabled? to decide whether to request a streaming response from the API. When disabled, the stream is replaced with nil before the transport layer executes the request.

All callback methods inherited from LLM::Stream are no-ops, so a disabled stream can be used safely wherever a stream object is expected.

Instance Method Summary collapse

Methods inherited from LLM::Stream

#__find__, #ctx, #extra, #on_compaction, #on_compaction_finish, #on_content, #on_reasoning_content, #on_tool_call, #on_tool_return, #on_transform, #on_transform_finish, #queue, try, #wait

Instance Method Details

#enabled?false

Returns:

  • (false)


19
20
21
# File 'lib/llm/stream/disabled.rb', line 19

def enabled?
  false
end