Class: ActiveRage::Configuration
- Inherits:
-
Object
- Object
- ActiveRage::Configuration
- Defined in:
- lib/active_rage/configuration.rb
Instance Attribute Summary collapse
-
#embedding_model ⇒ Object
Returns the value of attribute embedding_model.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#search_limit ⇒ Object
Returns the value of attribute search_limit.
-
#vector_dimensions ⇒ Object
Returns the value of attribute vector_dimensions.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #load_from_file(path) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
7 8 9 10 11 12 |
# File 'lib/active_rage/configuration.rb', line 7 def initialize @environment = 'development' = nil @search_limit = 10 @vector_dimensions = 1536 end |
Instance Attribute Details
#embedding_model ⇒ Object
Returns the value of attribute embedding_model.
5 6 7 |
# File 'lib/active_rage/configuration.rb', line 5 def end |
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/active_rage/configuration.rb', line 5 def environment @environment end |
#search_limit ⇒ Object
Returns the value of attribute search_limit.
5 6 7 |
# File 'lib/active_rage/configuration.rb', line 5 def search_limit @search_limit end |
#vector_dimensions ⇒ Object
Returns the value of attribute vector_dimensions.
5 6 7 |
# File 'lib/active_rage/configuration.rb', line 5 def vector_dimensions @vector_dimensions end |
Instance Method Details
#load_from_file(path) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/active_rage/configuration.rb', line 14 def load_from_file(path) return unless File.exist?(path) config = YAML.load_file(path)[environment] return unless config config.each do |key, value| public_send("#{key}=", value) if respond_to?("#{key}=") end end |