Class: InstLLM::Parameter::CohereEmbedParameters

Inherits:
Object
  • Object
show all
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

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: [], **options)
  @model = model
  @texts = texts
  @options = DEFAULT_OPTIONS.merge(options.slice(*DEFAULT_OPTIONS.keys)).compact
end

Instance Method Details

#to_hashObject



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