Class: Durable::Llm::Providers::OpenAI::OpenAIStreamResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/durable/llm/providers/openai.rb

Overview

Response object for streaming OpenAI chat completion chunks.

This wraps individual chunks from the Server-Sent Events stream, providing access to the incremental content updates.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parsed) ⇒ OpenAIStreamResponse

Returns a new instance of OpenAIStreamResponse.



332
333
334
# File 'lib/durable/llm/providers/openai.rb', line 332

def initialize(parsed)
  @choices = OpenAIStreamChoice.new(parsed['choices'])
end

Instance Attribute Details

#choicesObject (readonly)

Returns the value of attribute choices.



330
331
332
# File 'lib/durable/llm/providers/openai.rb', line 330

def choices
  @choices
end

Instance Method Details

#to_sObject



336
337
338
# File 'lib/durable/llm/providers/openai.rb', line 336

def to_s
  @choices.to_s
end