Exception: DSPy::ConfigurationError

Inherits:
Error
  • Object
show all
Defined in:
lib/dspy/errors.rb

Class Method Summary collapse

Class Method Details

.missing_lm(module_name) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dspy/errors.rb', line 11

def self.missing_lm(module_name)
  new("    No language model configured for \#{module_name} module.\n\n    To fix this, configure a language model either globally:\n\n      DSPy.configure do |config|\n        config.lm = DSPy::LM.new(\"openai/gpt-4\", api_key: ENV[\"OPENAI_API_KEY\"])\n      end\n\n    Or on the module instance:\n\n      module_instance.configure do |config|\n        config.lm = DSPy::LM.new(\"anthropic/claude-3\", api_key: ENV[\"ANTHROPIC_API_KEY\"])\n      end\n  MESSAGE\nend\n")