Class: Durable::Llm::Providers::Cohere::CohereStreamResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Cohere::CohereStreamResponse
- Defined in:
- lib/durable/llm/providers/cohere.rb
Overview
Response object for streaming Cohere chat chunks.
Wraps individual chunks from the Server-Sent Events stream.
Instance Attribute Summary collapse
-
#choices ⇒ Object
readonly
Returns the value of attribute choices.
Instance Method Summary collapse
-
#initialize(parsed) ⇒ CohereStreamResponse
constructor
A new instance of CohereStreamResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(parsed) ⇒ CohereStreamResponse
Returns a new instance of CohereStreamResponse.
203 204 205 |
# File 'lib/durable/llm/providers/cohere.rb', line 203 def initialize(parsed) @choices = [CohereStreamChoice.new(parsed['delta'])] end |
Instance Attribute Details
#choices ⇒ Object (readonly)
Returns the value of attribute choices.
201 202 203 |
# File 'lib/durable/llm/providers/cohere.rb', line 201 def choices @choices end |
Instance Method Details
#to_s ⇒ Object
207 208 209 |
# File 'lib/durable/llm/providers/cohere.rb', line 207 def to_s @choices.map(&:to_s).join(' ') end |