Examples: cookbook¶
Short recipes for common production needs. Back to the Examples gallery. Files here: 8.
| File | Shows | Install | Run | Docs |
|---|---|---|---|---|
examples/cookbook_approval_notify.py |
Cookbook: ask a reviewer over Slack or email, then resume the call they decided. | pip install agent-adapter |
python examples/cookbook_approval_notify.py |
Approval over Slack or email |
examples/cookbook_fakes.py |
Cookbook: give tools their clients through the context, so tests pass fakes instead. | pip install agent-adapter |
python examples/cookbook_fakes.py |
Test tools with fakes |
examples/cookbook_llm_cache.py |
Cookbook: cache model answers across workers with Redis (fakeredis here, offline). | pip install agent-adapter fakeredis |
python examples/cookbook_llm_cache.py |
Cache model answers across workers |
examples/cookbook_parallel_timeout.py |
Cookbook: ask several retrievers at once; a per-tool timeout and a deadline for the batch. | pip install agent-adapter |
python examples/cookbook_parallel_timeout.py |
Parallel retrieval with a deadline |
examples/cookbook_redact.py |
Cookbook: keep secrets and personal data out of logs, and out of what the model sees. | pip install agent-adapter |
python examples/cookbook_redact.py |
Redact arguments and results |
examples/cookbook_retry.py |
Cookbook: retry a flaky tool with backoff, and keep bad input from being retried. | pip install agent-adapter |
python examples/cookbook_retry.py |
Retry a flaky tool |
examples/cookbook_tenants.py |
Cookbook: one registry, a tool subset per tenant, one shared executor. | pip install agent-adapter |
python examples/cookbook_tenants.py |
A registry per tenant |
examples/cookbook_user_budget.py |
Cookbook: cap what each user may spend per day, with one ledger per user and day. | pip install agent-adapter |
python examples/cookbook_user_budget.py |
Cap spend per user |