motleycrew.agents.langchain.legacy_react
Classes
|
Basic ReAct agent compatible with older models without dedicated tool calling support. |
- class motleycrew.agents.langchain.legacy_react.LegacyReActMotleyAgent(tools: Sequence[MotleySupportedTool], description: str | None = None, name: str | None = None, prompt_prefix: str | None = None, chat_history: bool | GetSessionHistoryCallable = True, force_output_handler: bool = False, prompt: str | None = None, handle_parsing_errors: bool = True, handle_tool_errors: bool = True, llm: BaseLanguageModel | None = None, runnable_config: RunnableConfig | None = None, verbose: bool = False)
Bases:
LangchainMotleyAgentBasic ReAct agent compatible with older models without dedicated tool calling support.
It’s probably better to use the more advanced
motleycrew.agents.langchain.tool_calling_react.ReActToolCallingAgentwith newer models.- __init__(tools: Sequence[MotleySupportedTool], description: str | None = None, name: str | None = None, prompt_prefix: str | None = None, chat_history: bool | GetSessionHistoryCallable = True, force_output_handler: bool = False, prompt: str | None = None, handle_parsing_errors: bool = True, handle_tool_errors: bool = True, llm: BaseLanguageModel | None = None, runnable_config: RunnableConfig | None = None, verbose: bool = False)
- Parameters:
tools – Tools to add to the agent.
description – Description of the agent.
name – Name of the agent.
prompt_prefix – Prefix to the agent’s prompt.
output_handler – Output handler for the agent.
chat_history – Whether to use chat history or not.
force_output_handler – Whether to force the agent to return through an output handler.
prompt – Custom prompt to use with the agent.
handle_parsing_errors – Whether to handle parsing errors.
handle_tool_errors – Whether to handle tool errors.
llm – Language model to use.
runnable_config – Default Langchain config to use when invoking the agent. It can be used to add callbacks, metadata, etc.
verbose – Whether to log verbose output.