Class: RubyLLM::Model::Modalities
- Inherits:
-
Object
- Object
- RubyLLM::Model::Modalities
- Defined in:
- lib/ruby_llm/model/modalities.rb
Overview
Holds and manages input and output modalities for a language model
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(data) ⇒ Modalities
constructor
A new instance of Modalities.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ Modalities
Returns a new instance of Modalities.
9 10 11 12 |
# File 'lib/ruby_llm/model/modalities.rb', line 9 def initialize(data) @input = Array(data[:input]).map(&:to_s) @output = Array(data[:output]).map(&:to_s) end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
7 8 9 |
# File 'lib/ruby_llm/model/modalities.rb', line 7 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/ruby_llm/model/modalities.rb', line 7 def output @output end |
Instance Method Details
#to_h ⇒ Object
14 15 16 17 18 19 |
# File 'lib/ruby_llm/model/modalities.rb', line 14 def to_h { input: input, output: output } end |