check for agent

Former-commit-id: de103eb3e3
workerULTRANODE
Kye 2 years ago
parent a789c276ef
commit 2d03356eb0

@ -41,6 +41,10 @@ class AgentManager:
builder = AgentBuilder(self.toolsets) builder = AgentBuilder(self.toolsets)
builder.build_parser() builder.build_parser()
agent = builder.get_agent()
if not agent:
raise ValueError("Agent not created")
callbacks = [] callbacks = []
eval_callback = EVALCallbackHandler() eval_callback = EVALCallbackHandler()
eval_callback.set_parser(builder.get_parser()) eval_callback.set_parser(builder.get_parser())
@ -70,7 +74,7 @@ class AgentManager:
tool.callback_manager = callback_manager tool.callback_manager = callback_manager
executor = AgentExecutor.from_agent_and_tools( executor = AgentExecutor.from_agent_and_tools(
agent=builder.get_agent(), agent=agent,
tools=tools, tools=tools,
memory=memory, memory=memory,
callback_manager=callback_manager, callback_manager=callback_manager,

Loading…
Cancel
Save