motleycrew.common.exceptions

Exceptions for motleycrew

Exceptions

AgentNotMaterialized(agent_name)

Raised when an attempt is made to use an agent that is not yet materialized.

CannotModifyMaterializedAgent(agent_name)

Raised when an attempt is made to modify a materialized agent, e.g. to add tools.

IntegrationTestException(test_names)

One or more integration tests failed.

InvalidOutput

Raised in output handlers when an agent's output is not accepted.

InvalidToolInput(tool, input[, message])

Raised when the tool input is invalid

IpynbIntegrationTestResultNotFound(...)

Raised when the result file of an ipynb integration test run is not found.

LLMFrameworkNotSupported(llm_framework)

Raised when an LLM framework is not supported in motleycrew.

LLMProviderNotSupported(llm_framework, ...)

Raised when an LLM provider is not supported in motleycrew via a framework.

ModuleNotInstalled(module_name[, ...])

Raised when trying to use some functionality that requires a module that is not installed.

TaskDependencyCycleError

Raised when a task is set to depend on itself

exception motleycrew.common.exceptions.LLMProviderNotSupported(llm_framework: str, llm_provider: str)

Bases: Exception

Raised when an LLM provider is not supported in motleycrew via a framework.

__init__(llm_framework: str, llm_provider: str)
exception motleycrew.common.exceptions.LLMFrameworkNotSupported(llm_framework: str)

Bases: Exception

Raised when an LLM framework is not supported in motleycrew.

__init__(llm_framework: str)
exception motleycrew.common.exceptions.AgentNotMaterialized(agent_name: str)

Bases: Exception

Raised when an attempt is made to use an agent that is not yet materialized.

__init__(agent_name: str)
exception motleycrew.common.exceptions.CannotModifyMaterializedAgent(agent_name: str | None)

Bases: Exception

Raised when an attempt is made to modify a materialized agent, e.g. to add tools.

__init__(agent_name: str | None)
exception motleycrew.common.exceptions.TaskDependencyCycleError

Bases: Exception

Raised when a task is set to depend on itself

exception motleycrew.common.exceptions.IntegrationTestException(test_names: list[str])

Bases: Exception

One or more integration tests failed.

__init__(test_names: list[str])
Parameters:

test_names – List of names of failed integration tests.

exception motleycrew.common.exceptions.IpynbIntegrationTestResultNotFound(ipynb_path: str, result_path: str)

Bases: Exception

Raised when the result file of an ipynb integration test run is not found.

__init__(ipynb_path: str, result_path: str)
exception motleycrew.common.exceptions.ModuleNotInstalled(module_name: str, install_command: str = None)

Bases: Exception

Raised when trying to use some functionality that requires a module that is not installed.

__init__(module_name: str, install_command: str = None)
Parameters:
  • module_name – Name of the module.

  • install_command – Command to install the module.

exception motleycrew.common.exceptions.InvalidToolInput(tool: Any, input: Any, message: str | None = None)

Bases: Exception

Raised when the tool input is invalid

__init__(tool: Any, input: Any, message: str | None = None)
exception motleycrew.common.exceptions.InvalidOutput

Bases: Exception

Raised in output handlers when an agent’s output is not accepted.