Class: Durable::Llm::Providers::Together::TogetherChoice

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

Overview

Represents a choice in the Together API response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(choice) ⇒ TogetherChoice

Initializes a choice.

Parameters:

  • choice (Hash)

    The choice data



230
231
232
233
# File 'lib/durable/llm/providers/together.rb', line 230

def initialize(choice)
  @message = TogetherMessage.new(choice['message'])
  @finish_reason = choice['finish_reason']
end

Instance Attribute Details

#finish_reasonObject (readonly)

Returns the value of attribute finish_reason.



225
226
227
# File 'lib/durable/llm/providers/together.rb', line 225

def finish_reason
  @finish_reason
end

#messageObject (readonly)

Returns the value of attribute message.



225
226
227
# File 'lib/durable/llm/providers/together.rb', line 225

def message
  @message
end

Instance Method Details

#to_sString

Converts the choice to string.

Returns:

  • (String)

    The message content



238
239
240
# File 'lib/durable/llm/providers/together.rb', line 238

def to_s
  @message.to_s
end