10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/dspy/anthropic/guardrails.rb', line 10
def self.ensure_anthropic_installed!
require 'anthropic'
spec = Gem.loaded_specs["anthropic"]
unless spec && Gem::Requirement.new(SUPPORTED_ANTHROPIC_VERSIONS).satisfied_by?(spec.version)
msg = " DSPY requires the `anthropic` gem \#{SUPPORTED_ANTHROPIC_VERSIONS}.\n Please install or upgrade it with `bundle add anthropic --version \"\#{SUPPORTED_ANTHROPIC_VERSIONS}\"`.\n MSG\n raise DSPy::LM::UnsupportedVersionError, msg\n end\nend\n"
|