Don't pass sanitize_inputs_outputs=True to managed agents (#85)

This commit is contained in:
Tom McKenzie 2025-01-06 10:27:10 -08:00 committed by GitHub
parent 0824785b7a
commit ff8e20d93f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 6 deletions

View File

@ -388,6 +388,9 @@ class MultiStepAgent:
try: try:
if isinstance(arguments, str): if isinstance(arguments, str):
if tool_name in self.managed_agents:
observation = available_tools[tool_name].__call__(arguments)
else:
observation = available_tools[tool_name].__call__( observation = available_tools[tool_name].__call__(
arguments, sanitize_inputs_outputs=True arguments, sanitize_inputs_outputs=True
) )
@ -395,6 +398,9 @@ class MultiStepAgent:
for key, value in arguments.items(): for key, value in arguments.items():
if isinstance(value, str) and value in self.state: if isinstance(value, str) and value in self.state:
arguments[key] = self.state[value] arguments[key] = self.state[value]
if tool_name in self.managed_agents:
observation = available_tools[tool_name].__call__(**arguments)
else:
observation = available_tools[tool_name].__call__( observation = available_tools[tool_name].__call__(
**arguments, sanitize_inputs_outputs=True **arguments, sanitize_inputs_outputs=True
) )