Class: Ollama::Message

Inherits:
Object
  • Object
show all
Includes:
DTO
Defined in:
lib/ollama/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DTO

#as_array_of_hashes, #as_json, #empty?, #to_json

Constructor Details

#initialize(role:, content:, images: nil) ⇒ Message

Returns a new instance of Message.



6
7
8
# File 'lib/ollama/message.rb', line 6

def initialize(role:, content:, images: nil, **)
  @role, @content, @images = role, content, (Array(images) if images)
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



4
5
6
# File 'lib/ollama/message.rb', line 4

def content
  @content
end

#imagesObject (readonly)

Returns the value of attribute images.



4
5
6
# File 'lib/ollama/message.rb', line 4

def images
  @images
end

#roleObject (readonly)

Returns the value of attribute role.



4
5
6
# File 'lib/ollama/message.rb', line 4

def role
  @role
end