Class: Durable::Llm::Providers::OpenAI::OpenAIMessage

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ OpenAIMessage

Returns a new instance of OpenAIMessage.



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

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



182
183
184
# File 'lib/durable/llm/providers/openai.rb', line 182

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



182
183
184
# File 'lib/durable/llm/providers/openai.rb', line 182

def role
  @role
end

Instance Method Details

#to_sObject



189
190
191
# File 'lib/durable/llm/providers/openai.rb', line 189

def to_s
  @content
end