MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / run

Method run

tests/iterative_agent_tests/test_helpers.py:114–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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):

Callers 15

_check_rust_lintingMethod · 0.80
_check_python_lintingMethod · 0.80
_run_security_scanMethod · 0.80
_check_dependenciesMethod · 0.80
_check_documentationMethod · 0.80
get_commits_since_tagMethod · 0.80
get_latest_tagMethod · 0.80

Calls 7

add_nodeMethod · 0.95
WorkflowClass · 0.50
agentMethod · 0.45
executeMethod · 0.45
get_node_outputMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected