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: str | None = None, chat_history: bool | GetSessionHistoryCallable = True, force_output_handler: bool = False, internal_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: str | None = None, chat_history: bool | GetSessionHistoryCallable = True, force_output_handler: bool = False, internal_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 – Prompt for the agent. If a string, it will be used as a prompt. If a string containing f-string-style placeholders, it will be used as a prompt template.
chat_history – Whether to use chat history or not.
force_output_handler – Whether to force the agent to return through an output handler.
internal_prompt – Internal 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.