Class: Durable::Llm::Providers::Cohere::CohereStreamResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parsed) ⇒ CohereStreamResponse

Returns a new instance of CohereStreamResponse.



190
191
192
# File 'lib/durable/llm/providers/cohere.rb', line 190

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

Instance Attribute Details

#choicesObject (readonly)

Returns the value of attribute choices.



188
189
190
# File 'lib/durable/llm/providers/cohere.rb', line 188

def choices
  @choices
end

Instance Method Details

#to_sObject



194
195
196
# File 'lib/durable/llm/providers/cohere.rb', line 194

def to_s
  @choices.map(&:to_s).join(' ')
end