This guide matches the smallest integration surface published in this repo. It is enough to validate your HTTP stack, JSON contract, and local tooling before wiring a larger batch pipeline.
Run a mock inference HTTP service and a stdlib-only client that POSTs the same JSON shape a mock_api-style backend consumes in the full Agentic Testing Framework.
- Python 3.9+
-
Clone this repository.
-
Open a terminal in
examples/mock_api_roundtrip/. -
Start the server:
python3 mock_server.py
-
In a second terminal, run the client:
python3 run_client.py
You should see HTTP 200 and a JSON body whose result (or top-level) includes decision, code, and msg.
The mock server expects POST JSON with:
photo_path(string)metrics(object)thresholds(object)
Either:
{ "result": { "decision": "...", "code": "...", "msg": "..." } }, or- a bare
{ "decision": "...", "code": "...", "msg": "..." }.
See inference-contract.md for valid decision labels used in the full framework.
If the environment variable MOCK_INFER_API_KEY is set, the server requires:
Authorization: Bearer <same value>
run_client.py reads the same variable and sends the header when present.
- Read
inference-contract.md. - See
README.mdfor the article index. The full batch pipeline is documented in public slice vs. full framework.