Skip to content

Commit e60034e

Browse files
committed
docs: add API Examples (curl POST /ask and GET /trace/{id}; CLI replay usage)
1 parent e5fda10 commit e60034e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,22 @@ OpenAPI:
8282
- FastAPI publishes `/openapi.json` and interactive docs at `/docs`.
8383
- Schemas reflect `AskRequest` and `AskResponse` models in `micro_agent/server.py`.
8484
85+
### API Examples
86+
- Ask, capture `trace_id`, then fetch the full trace by id:
87+
```bash
88+
RESP=$(curl -s http://localhost:8000/ask \
89+
-H 'content-type: application/json' \
90+
-d '{"question":"Add 12345 and 67890, then UTC time.","max_steps":6}')
91+
echo "$RESP" | jq .
92+
TID=$(echo "$RESP" | jq -r .trace_id)
93+
curl -s http://localhost:8000/trace/$TID | jq .
94+
```
95+
96+
- Replay the saved JSONL locally using the CLI (last record by default index -1):
97+
```bash
98+
micro-agent replay --path traces/$TID.jsonl --index -1
99+
```
100+
85101
## Tools
86102
- Built-ins live in `micro_agent/tools.py`:
87103
- `calculator`: safe expression evaluator. Supports `+ - * / ** % // ( )` and `!` via rewrite to `fact(n)`.

0 commit comments

Comments
 (0)