Module: BxBuilderChain::DependencyHelper
- Included in:
- Llm::Base, Processors::Base, Vectorsearch::Base
- Defined in:
- lib/bx_builder_chain/dependency_helper.rb
Defined Under Namespace
Classes: VersionError
Instance Method Summary collapse
-
#depends_on(gem_name) ⇒ Boolean
This method requires and loads the given gem, and then checks to see if the version of the gem meets the requirements listed in ‘langchain.gemspec` This solution was built to avoid auto-loading every single gem in the Gemfile when the developer will mostly likely be only using a few of them.
Instance Method Details
#depends_on(gem_name) ⇒ Boolean
This method requires and loads the given gem, and then checks to see if the version of the gem meets the requirements listed in ‘langchain.gemspec` This solution was built to avoid auto-loading every single gem in the Gemfile when the developer will mostly likely be only using a few of them.
15 16 17 18 19 20 |
# File 'lib/bx_builder_chain/dependency_helper.rb', line 15 def depends_on(gem_name) Gem::Specification.find_by_name(gem_name) true rescue LoadError raise LoadError, "!Could not load #{gem_name}. Please ensure that the #{gem_name} gem is installed." end |