()
| 112 | def test_single_tool_call(self): |
| 113 | """Test 1: Single tool call (add 5 + 3 = 8).""" |
| 114 | def run(): |
| 115 | workflow = Workflow(f"{self.provider_name}Single") |
| 116 | agent = Node.agent( |
| 117 | name="Calc", |
| 118 | prompt="Calculate 5 + 3 STRICTLY using the available add tool. Return ONLY the numeric result.", |
| 119 | tools=[add], |
| 120 | ) |
| 121 | workflow.add_node(agent) |
| 122 | result = self.executor.execute(workflow) |
| 123 | output = result.get_node_output("Calc") |
| 124 | metadata = result.get_node_response_metadata("Calc") |
| 125 | print(f" Output: {output}") |
| 126 | print(f" Iterations: {metadata.get('total_iterations')}") |
| 127 | print(f" Tool calls: {len(metadata.get('tools_used', []))}") |
| 128 | # print(metadata) |
| 129 | assert "8" in str(output), f"Expected '8' in output, got: {output}" |
| 130 | assert metadata.get('total_iterations', 0) >= 1, "Expected at least 1 iteration" |
| 131 | self.run_test("Single Tool Call (add 5+3=8)", run) |
| 132 | |
| 133 | def test_multi_step_chain(self): |
no test coverage detected