Class: Durable::Llm::Providers::OpenRouter::OpenRouterMessage

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

Overview

Message wrapper for OpenRouter API responses.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ OpenRouterMessage

Returns a new instance of OpenRouterMessage.



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

def initialize(message)
  @role = message['role']
  @content = message['content']
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



185
186
187
# File 'lib/durable/llm/providers/openrouter.rb', line 185

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



185
186
187
# File 'lib/durable/llm/providers/openrouter.rb', line 185

def role
  @role
end

Instance Method Details

#to_sObject



192
193
194
# File 'lib/durable/llm/providers/openrouter.rb', line 192

def to_s
  @content
end