MCPcopy Index your code
hub / github.com/AI45Lab/Code / test_prompt_mode

Function test_prompt_mode

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

Source from the content-addressed store, hash-verified

201 # ── Test 5: Prompt mode ──────────────────────────────────────────────────
202
203 def test_prompt_mode():
204 result = session.tool("generate_object", {
205 "schema": {
206 "type": "object",
207 "required": ["result"],
208 "properties": {
209 "result": {"type": "integer"},
210 },
211 },
212 "prompt": "What is 13 * 7? Return the numeric result.",
213 "schema_name": "math",
214 "mode": "prompt",
215 })
216 assert result.exit_code == 0, f"Tool failed: {result.output}"
217 parsed = json.loads(result.output)
218 assert parsed["object"]["result"] == 91, f"Expected 91, got {parsed['object']['result']}"
219 print(f" Result: 13*7 = {parsed['object']['result']}")
220
221 run_test("generate_object: prompt mode (math)", test_prompt_mode)
222

Callers

nothing calls this directly

Calls 1

toolMethod · 0.45

Tested by

no test coverage detected