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

Function _write_agent_dir

sdk/python/tests/test_serve.py:37–54  ·  view source on GitHub ↗
(*, with_schedule: bool, with_tools: bool = False)

Source from the content-addressed store, hash-verified

35
36
37def _write_agent_dir(*, with_schedule: bool, with_tools: bool = False) -> str:
38 base = tempfile.mkdtemp(prefix="a3s-code-serve-")
39 pathlib.Path(base, "instructions.md").write_text(
40 "You are a terse test agent. Answer in one word."
41 )
42 if with_schedule:
43 sched = pathlib.Path(base, "schedules")
44 sched.mkdir()
45 (sched / "tick.md").write_text(
46 '---\ncron: "* * * * * *"\nname: tick\n---\nReply with exactly one word: PONG'
47 )
48 if with_tools:
49 tools = pathlib.Path(base, "tools")
50 tools.mkdir()
51 (tools / "echo.md").write_text(
52 "---\nkind: script\nname: echo-tool\npath: scripts/echo.js\n---\nEcho tool.\n"
53 )
54 return base
55
56
57def test_serve_with_script_tool() -> None:

Callers 3

test_serve_real_scheduleFunction · 0.85

Calls 1

write_textMethod · 0.45

Tested by

no test coverage detected