Class: MagicQuery::Configuration
- Inherits:
-
Object
- Object
- MagicQuery::Configuration
- Defined in:
- lib/magic_query/configuration.rb
Constant Summary collapse
- PROVIDER_MAP =
{ openai: ['providers/openai', 'OpenAI'], claude: ['providers/claude', 'Claude'], gemini: ['providers/gemini', 'Gemini'] }.freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_prompt ⇒ Object
Returns the value of attribute base_prompt.
-
#database_url ⇒ Object
Returns the value of attribute database_url.
-
#max_tokens ⇒ Object
Returns the value of attribute max_tokens.
-
#model ⇒ Object
Returns the value of attribute model.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#rules_path ⇒ Object
Returns the value of attribute rules_path.
-
#schema_path ⇒ Object
Returns the value of attribute schema_path.
-
#temperature ⇒ Object
Returns the value of attribute temperature.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #provider_class ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/magic_query/configuration.rb', line 14 def initialize @provider = :openai @api_key = nil @model = nil @schema_path = nil @rules_path = nil @database_url = nil @base_prompt = nil @temperature = 0.3 @max_tokens = 1000 end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def api_key @api_key end |
#base_prompt ⇒ Object
Returns the value of attribute base_prompt.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def base_prompt @base_prompt end |
#database_url ⇒ Object
Returns the value of attribute database_url.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def database_url @database_url end |
#max_tokens ⇒ Object
Returns the value of attribute max_tokens.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def max_tokens @max_tokens end |
#model ⇒ Object
Returns the value of attribute model.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def model @model end |
#provider ⇒ Object
Returns the value of attribute provider.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def provider @provider end |
#rules_path ⇒ Object
Returns the value of attribute rules_path.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def rules_path @rules_path end |
#schema_path ⇒ Object
Returns the value of attribute schema_path.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def schema_path @schema_path end |
#temperature ⇒ Object
Returns the value of attribute temperature.
5 6 7 |
# File 'lib/magic_query/configuration.rb', line 5 def temperature @temperature end |
Instance Method Details
#provider_class ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/magic_query/configuration.rb', line 26 def provider_class provider_info = PROVIDER_MAP[provider.to_sym] raise Error, "Unknown provider: #{provider}" unless provider_info require_relative provider_info[0] Providers.const_get(provider_info[1]) end |