Open ChavesLiu opened 3 weeks ago
Add code to line 583
# Update the agent with any overrides
agent_state = client.update_agent(
agent_id=agent_state.id,
name=agent_state.name,
llm_config=agent_state.llm_config,
embedding_config=agent_state.embedding_config,
)
# >>>> add code
tools = []
for tool_name in agent_state.tools:
tool = ms.get_tool(tool_name, agent_state.user_id)
if tool is None:
typer.secho(f"Couldn't find tool {tool_name} in database, please run `memgpt add tool`", fg=typer.colors.RED)
tools.append(tool)
# <<< end
# create agent
memgpt_agent = Agent(agent_state=agent_state, interface=interface(), tools=tools)
How to merge into the main branch.
File "/opt/anaconda3/envs/pymemgpt/lib/python3.11/site-packages/memgpt/cli/cli.py", line 585, in run memgpt_agent = Agent(agent_state=agent_state, interface=interface(), tools=tools) UnboundLocalError: cannot access local variable 'tools' where it is not associated with a value