MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_agent_driven

Function test_agent_driven

sdk/python/examples/test_generate_object.py:225–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 # ── Test 6: Agent-driven (session.send) ──────────────────────────────────
224
225 def test_agent_driven():
226 result = session.send(
227 'Use the generate_object tool to produce a JSON object with schema '
228 '{"type":"object","required":["language","paradigm"],"properties":'
229 '{"language":{"type":"string"},"paradigm":{"type":"string"}}} '
230 'for the following: "Rust is a systems programming language with a focus on safety."'
231 )
232 assert result.text is not None
233 # Agent should have used the tool
234 print(f" Tool calls: {result.tool_calls_count}, tokens: {result.total_tokens}")
235
236 run_test("generate_object: agent-driven via session.send", test_agent_driven)
237

Callers

nothing calls this directly

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected