Class: Girb::Configuration
- Inherits:
-
Object
- Object
- Girb::Configuration
- Defined in:
- lib/girb/configuration.rb
Instance Attribute Summary collapse
-
#custom_prompt ⇒ Object
Returns the value of attribute custom_prompt.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#provider ⇒ Object
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#provider! ⇒ Object
Get the configured provider, or raise an error if not configured.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 |
# File 'lib/girb/configuration.rb', line 7 def initialize @provider = nil @debug = ENV["GIRB_DEBUG"] == "1" @custom_prompt = nil end |
Instance Attribute Details
#custom_prompt ⇒ Object
Returns the value of attribute custom_prompt.
5 6 7 |
# File 'lib/girb/configuration.rb', line 5 def custom_prompt @custom_prompt end |
#debug ⇒ Object
Returns the value of attribute debug.
5 6 7 |
# File 'lib/girb/configuration.rb', line 5 def debug @debug end |
#provider ⇒ Object
Returns the value of attribute provider.
5 6 7 |
# File 'lib/girb/configuration.rb', line 5 def provider @provider end |
Instance Method Details
#provider! ⇒ Object
Get the configured provider, or raise an error if not configured
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/girb/configuration.rb', line 14 def provider! return @provider if @provider raise ConfigurationError, <<~MSG No LLM provider configured. Install a provider gem and set GIRB_PROVIDER environment variable: gem install girb-ruby_llm export GIRB_PROVIDER=girb-ruby_llm Or implement your own provider: class MyProvider < Girb::Providers::Base def chat(messages:, system_prompt:, tools:) # Your implementation end end Girb.configure do |c| c.provider = MyProvider.new end MSG end |