- Direct client: Call
client.log(...)where you construct the payload. - Decorator: Wrap your retrieval function to auto-capture inputs/outputs.
New to the context format? See Context & Event Schema for the exact shapes.
Install & Initialize
- Python
- TypeScript
Option A: Direct Logging (client.log)
Use this when you already have the query + context assembled.
- Python
- TypeScript
contextmust be eitherlist[str]/string[]orlist[dict]/Passage[]. If using dicts/objects, includetext. Full shape + examples: Context & Event Schema.metadatais free-form. Include anything you want to filter by later.sample_ratecontrols what % of events get evaluated (for cost management).
Option B: Decorator / Wrapper
The decorator (Python) or wrapper (TypeScript) eliminates boilerplate by mapping your function’s arguments/return to Seer’s event fields.Pattern 1: Context from Return Value
For retrieval functions where the return value is the context:- Python
- TypeScript
list[dict] / Passage[] (must have text key) or list[str] / string[] (auto-converted).
Pattern 2: Context from Input Argument
For processing functions where context is an input argument (not the return):- Python
- TypeScript
Options
- Python
- TypeScript
Use either
context_from_return=True / contextFromReturn: true or context_arg / contextArgIndex. They are mutually exclusive.Adding Metadata
- Python
- TypeScript
Choosing Between Client vs Decorator
Fire-and-Forget vs Synchronous
By default, the SDK uses fire-and-forget mode. Events are queued and sent asynchronously in the background.- Python
- TypeScript
OpenTelemetry Integration
The SDK automatically captures OTEL trace context when available:- Python
- TypeScript
- Python
- TypeScript
What Happens After Logging
Once logs arrive, Seer evaluates each retrieval and computes Recall, Precision, F1, and nDCG, all without labeled data. See Metrics for full definitions and worked examples.Next Steps
- SDK Reference: Python | TypeScript
- Metrics
- Change Testing (A/B)
- Production Monitoring