Class: Raif::EmbeddingModel
- Inherits:
-
Object
- Object
- Raif::EmbeddingModel
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/raif/embedding_model.rb
Direct Known Subclasses
Raif::EmbeddingModels::BedrockTitan, Raif::EmbeddingModels::OpenAi
Instance Attribute Summary collapse
-
#api_name ⇒ Object
Returns the value of attribute api_name.
-
#default_output_vector_size ⇒ Object
Returns the value of attribute default_output_vector_size.
-
#input_token_cost ⇒ Object
Returns the value of attribute input_token_cost.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
Instance Attribute Details
#api_name ⇒ Object
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_size ⇒ Object
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_cost ⇒ Object
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 |
#key ⇒ Object
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
19 20 21 |
# File 'app/models/raif/embedding_model.rb', line 19 def (input, dimensions: nil) raise NotImplementedError, "#{self.class.name} must implement #generate_embedding!" end |
#name ⇒ Object
15 16 17 |
# File 'app/models/raif/embedding_model.rb', line 15 def name I18n.t("raif.embedding_model_names.#{key}") end |