Class: Spectre::Configuration
- Inherits:
-
Object
- Object
- Spectre::Configuration
- Defined in:
- lib/spectre.rb
Instance Attribute Summary collapse
-
#default_llm_provider ⇒ Object
Returns the value of attribute default_llm_provider.
-
#providers ⇒ Object
Returns the value of attribute providers.
Instance Method Summary collapse
- #claude {|| ... } ⇒ Object
- #gemini {|| ... } ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #ollama {|| ... } ⇒ Object
- #openai {|| ... } ⇒ Object
- #openrouter {|| ... } ⇒ Object
- #provider_configuration ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
46 47 48 |
# File 'lib/spectre.rb', line 46 def initialize @providers = {} end |
Instance Attribute Details
#default_llm_provider ⇒ Object
Returns the value of attribute default_llm_provider.
44 45 46 |
# File 'lib/spectre.rb', line 44 def default_llm_provider @default_llm_provider end |
#providers ⇒ Object
Returns the value of attribute providers.
44 45 46 |
# File 'lib/spectre.rb', line 44 def providers @providers end |
Instance Method Details
#claude {|| ... } ⇒ Object
60 61 62 63 |
# File 'lib/spectre.rb', line 60 def claude @providers[:claude] ||= ClaudeConfiguration.new yield @providers[:claude] if block_given? end |
#gemini {|| ... } ⇒ Object
65 66 67 68 |
# File 'lib/spectre.rb', line 65 def gemini @providers[:gemini] ||= GeminiConfiguration.new yield @providers[:gemini] if block_given? end |
#ollama {|| ... } ⇒ Object
55 56 57 58 |
# File 'lib/spectre.rb', line 55 def ollama @providers[:ollama] ||= OllamaConfiguration.new yield @providers[:ollama] if block_given? end |
#openai {|| ... } ⇒ Object
50 51 52 53 |
# File 'lib/spectre.rb', line 50 def openai @providers[:openai] ||= OpenaiConfiguration.new yield @providers[:openai] if block_given? end |
#openrouter {|| ... } ⇒ Object
70 71 72 73 |
# File 'lib/spectre.rb', line 70 def openrouter @providers[:openrouter] ||= OpenrouterConfiguration.new yield @providers[:openrouter] if block_given? end |
#provider_configuration ⇒ Object
75 76 77 |
# File 'lib/spectre.rb', line 75 def provider_configuration providers[default_llm_provider] || raise("No configuration found for provider: #{default_llm_provider}") end |