refactor(loading.py): add comment explaining type ignore for agent variable
This commit is contained in:
parent
f00420ecbe
commit
3b5b63e070
1 changed files with 3 additions and 1 deletions
|
|
@ -166,7 +166,9 @@ def load_agent_executor(agent_class: type[agent_module.Agent], params, **kwargs)
|
||||||
allowed_tools = params["allowed_tools"]
|
allowed_tools = params["allowed_tools"]
|
||||||
llm_chain = params["llm_chain"]
|
llm_chain = params["llm_chain"]
|
||||||
tool_names = [tool.name for tool in allowed_tools]
|
tool_names = [tool.name for tool in allowed_tools]
|
||||||
agent = agent_class(allowed_tools=tool_names, llm_chain=llm_chain)
|
# Agent class requires an output_parser but Agent classes
|
||||||
|
# have a default output_parser.
|
||||||
|
agent = agent_class(allowed_tools=tool_names, llm_chain=llm_chain) # type: ignore
|
||||||
return AgentExecutor.from_agent_and_tools(
|
return AgentExecutor.from_agent_and_tools(
|
||||||
agent=agent,
|
agent=agent,
|
||||||
tools=allowed_tools,
|
tools=allowed_tools,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue