Class: Durable::Llm::Providers::OpenAI::OpenAIStreamResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::OpenAI::OpenAIStreamResponse
- 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
-
#choices ⇒ Object
readonly
Returns the value of attribute choices.
Instance Method Summary collapse
-
#initialize(parsed) ⇒ OpenAIStreamResponse
constructor
A new instance of OpenAIStreamResponse.
- #to_s ⇒ Object
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
#choices ⇒ Object (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_s ⇒ Object
336 337 338 |
# File 'lib/durable/llm/providers/openai.rb', line 336 def to_s @choices.to_s end |