refactor(loading.py): use get method to set allowed_tools to an empty list if it is not present in params dictionary
This commit is contained in:
parent
9ffa88a773
commit
d79f655d88
1 changed files with 1 additions and 1 deletions
|
|
@ -193,7 +193,7 @@ def load_agent_executor_from_config(
|
|||
|
||||
def load_agent_executor(agent_class: type[agent_module.Agent], params, **kwargs):
|
||||
"""Load agent executor from agent class, tools and chain"""
|
||||
allowed_tools = params["allowed_tools"]
|
||||
allowed_tools = params.get("allowed_tools", [])
|
||||
llm_chain = params["llm_chain"]
|
||||
# if allowed_tools is not a list or set, make it a list
|
||||
if not isinstance(allowed_tools, (list, set)):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue