File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
atomic-examples/orchestration-agent/orchestration_agent Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,8 @@ class OrchestratorInputSchema(BaseIOSchema):
31
31
32
32
33
33
class OrchestratorOutputSchema (BaseIOSchema ):
34
- """Combined output schema for the Orchestrator Agent. Contains the tool to use and its parameters."""
34
+ """Combined output schema for the Orchestrator Agent. Contains the tool parameters."""
35
35
36
- tool : str = Field (..., description = "The tool to use: 'search' or 'calculator'" )
37
36
tool_parameters : Union [SearXNGSearchToolInputSchema , CalculatorToolInputSchema ] = Field (
38
37
..., description = "The parameters for the selected tool"
39
38
)
@@ -99,12 +98,12 @@ def get_info(self) -> str:
99
98
def execute_tool (
100
99
searxng_tool : SearXNGSearchTool , calculator_tool : CalculatorTool , orchestrator_output : OrchestratorOutputSchema
101
100
) -> Union [SearXNGSearchToolOutputSchema , CalculatorToolOutputSchema ]:
102
- if orchestrator_output .tool == "search" :
101
+ if isinstance ( orchestrator_output .tool_parameters , SearXNGSearchToolInputSchema ) :
103
102
return searxng_tool .run (orchestrator_output .tool_parameters )
104
- elif orchestrator_output .tool == "calculator" :
103
+ elif isinstance ( orchestrator_output .tool_parameters , CalculatorToolInputSchema ) :
105
104
return calculator_tool .run (orchestrator_output .tool_parameters )
106
105
else :
107
- raise ValueError (f"Unknown tool: { orchestrator_output .tool } " )
106
+ raise ValueError (f"Unknown tool parameters type : { type ( orchestrator_output .tool_parameters ) } " )
108
107
109
108
110
109
#################
You can’t perform that action at this time.
0 commit comments