Class: Raif::EmbeddingModel

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/raif/embedding_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_nameObject

Returns the value of attribute api_name.



6
7
8
# File 'app/models/raif/embedding_model.rb', line 6

def api_name
  @api_name
end

#default_output_vector_sizeObject

Returns the value of attribute default_output_vector_size.



6
7
8
# File 'app/models/raif/embedding_model.rb', line 6

def default_output_vector_size
  @default_output_vector_size
end

#input_token_costObject

Returns the value of attribute input_token_cost.



6
7
8
# File 'app/models/raif/embedding_model.rb', line 6

def input_token_cost
  @input_token_cost
end

#keyObject

Returns the value of attribute key.



6
7
8
# File 'app/models/raif/embedding_model.rb', line 6

def key
  @key
end

Instance Method Details

#generate_embedding!(input, dimensions: nil) ⇒ Object

Raises:

  • (NotImplementedError)


19
20
21
# File 'app/models/raif/embedding_model.rb', line 19

def generate_embedding!(input, dimensions: nil)
  raise NotImplementedError, "#{self.class.name} must implement #generate_embedding!"
end

#nameObject



15
16
17
# File 'app/models/raif/embedding_model.rb', line 15

def name
  I18n.t("raif.embedding_model_names.#{key}")
end