Class: InstLLM::Parameter::CohereEmbedParameters
- Inherits:
-
Object
- Object
- InstLLM::Parameter::CohereEmbedParameters
- Defined in:
- lib/inst_llm/parameter/cohere_embed_parameters.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ input_type: nil, truncate: nil }.freeze
Instance Method Summary collapse
-
#initialize(model:, texts: [], **options) ⇒ CohereEmbedParameters
constructor
A new instance of CohereEmbedParameters.
- #to_hash ⇒ Object
Constructor Details
#initialize(model:, texts: [], **options) ⇒ CohereEmbedParameters
Returns a new instance of CohereEmbedParameters.
11 12 13 14 15 |
# File 'lib/inst_llm/parameter/cohere_embed_parameters.rb', line 11 def initialize(model:, texts: [], **) @model = model @texts = texts @options = DEFAULT_OPTIONS.merge(.slice(*DEFAULT_OPTIONS.keys)).compact end |
Instance Method Details
#to_hash ⇒ Object
17 18 19 |
# File 'lib/inst_llm/parameter/cohere_embed_parameters.rb', line 17 def to_hash { model_id: @model, body: { texts: @texts }.merge(@options).to_json } end |