Feedback & annotations
Record what your users thought of a run or one step of it, and let your team leave notes on runs and spans.
Feedback is your end user's reaction to a run, or to one step of it: thumbs up or down, a rating, a comment. Annotations are your team's notes on a run or span, in the app.
Send feedback from your app
Call feedback with the run's ID when the user reacts. Set at least one of satisfaction, rating or comment.
const { result, runId } = await trodo.wrapAgent('support-agent', handler, { distinctId: user.id });
// send runId to your UI with the answer; when the user clicks thumbs-down:
await trodo.feedback(runId, { satisfaction: 'negative', comment: 'Wrong order number' });with trodo.wrap_agent("support-agent", distinct_id=user.id) as run:
...
# send run.run_id to your UI with the answer; when the user clicks thumbs-down:
trodo.feedback(run.run_id, satisfaction="negative", comment="Wrong order number")| Field | Type | What it is |
|---|---|---|
satisfaction | 'positive' or 'negative' | Thumbs up or down. Adds to the run's satisfaction score. |
rating | number | Any scale you use: 1 to 5, NPS. |
comment | string | What the user said. Searchable in Traces. |
metadata | object | Anything else, e.g. { source: 'thumbs_widget' }. |
spanId / span_id | string | Feedback on one step rather than the whole run. |
Each call adds a new entry; where the app shows one value it shows the latest. Feedback sent before its run has arrived is kept and attached when the run lands.
Feedback on one step
To say which step was wrong (the tool that returned the wrong order, say), pass the span's ID. Read it inside the step with span.spanId or trodo.currentSpanId() (Python: span.span_id, trodo.current_span_id()), and keep it with the answer you return to your UI.
let lookupSpanId: string | undefined;
await trodo.withSpan('lookup_order', async (span) => {
lookupSpanId = span.spanId;
// ...
}, { kind: 'tool' });
await trodo.feedback(runId, { spanId: lookupSpanId, satisfaction: 'negative', comment: 'wrong order' });Where it shows
On a run, feedback is in the Scores tab next to the eval verdicts. You can also give feedback there yourself: pick Good or Bad, a rating, or a comment. Traces → Runs shows each run's satisfaction (the Sat % column), and an alert can watch it.
Annotations
The Annotations tab on a run is a comment thread for your team. Comment on the run or on one of its spans, and @mention a teammate to notify them in their Trodo inbox. Annotations are notes for people. They don't change the run's satisfaction score or any eval verdict.
