Class: Durable::Llm::Providers::Cohere::CohereChoice

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

Overview

Represents a single choice in a Cohere response.

Contains the generated text content.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(generation) ⇒ CohereChoice

Returns a new instance of CohereChoice.



173
174
175
# File 'lib/durable/llm/providers/cohere.rb', line 173

def initialize(generation)
  @text = generation['text']
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



171
172
173
# File 'lib/durable/llm/providers/cohere.rb', line 171

def text
  @text
end

Instance Method Details

#to_sObject



177
178
179
# File 'lib/durable/llm/providers/cohere.rb', line 177

def to_s
  @text
end