Class: Durable::Llm::Providers::Opencode::OpencodeChoice

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

Overview

Choice class for OpenCode API responses

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(choice) ⇒ OpencodeChoice

Returns a new instance of OpencodeChoice.



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

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

Instance Attribute Details

#finish_reasonObject (readonly)

Returns the value of attribute finish_reason.



168
169
170
# File 'lib/durable/llm/providers/opencode.rb', line 168

def finish_reason
  @finish_reason
end

#messageObject (readonly)

Returns the value of attribute message.



168
169
170
# File 'lib/durable/llm/providers/opencode.rb', line 168

def message
  @message
end

Instance Method Details

#to_sObject



175
176
177
# File 'lib/durable/llm/providers/opencode.rb', line 175

def to_s
  @message.to_s
end