Sample Agent
File: examples/sample_agent.py
Minimal SDK smoke test. It starts a run, registers a mock get_weather tool, performs a single model turn, and closes the run with the assistant response.
Run
uv run examples/sample_agent.py
What It Does
- Creates a
TraceAgentClientconnected to the server - Starts a run named
"my-agent" - Registers a mock
get_weathertool call - Performs a single model turn
- Closes the run with the assistant response
When to Use
Use this when you want to confirm that the SDK can create runs, record tool calls, and finish cleanly. It's the simplest possible integration test.