Compare commits

...

2 Commits

Author SHA1 Message Date
Bagatur
2ff405df2a undo 2023-11-14 09:30:53 -08:00
Bagatur
f6e4c062f6 rm 2023-11-14 09:29:43 -08:00

View File

@@ -821,20 +821,6 @@ class AgentExecutor(Chain):
)
return values
@root_validator()
def validate_return_direct_tool(cls, values: Dict) -> Dict:
"""Validate that tools are compatible with agent."""
agent = values["agent"]
tools = values["tools"]
if isinstance(agent, BaseMultiActionAgent):
for tool in tools:
if tool.return_direct:
raise ValueError(
"Tools that have `return_direct=True` are not allowed "
"in multi-action agents"
)
return values
@root_validator(pre=True)
def validate_runnable_agent(cls, values: Dict) -> Dict:
"""Convert runnable to agent if passed in."""