Skip to main content

load_tools_from_package

Method
This is a method of the AgentsGenerator class in the agents_generator module.
Loads tools from a specified package path containing modules with functions or classes.

Signature

def load_tools_from_package(package_path: Any) -> Any

Parameters

package_path
Any
required
The path to the package containing the tools.

Returns

Returns
Any
A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.

Exceptions

If the specified package path does not exist.

Uses

  • os.listdir
  • importlib.import_module
  • inspect.getmembers

Source

View on GitHub

praisonai/agents_generator.py at line 268