One call toDocumentation Index
Fetch the complete documentation index at: https://docs.trodo.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
wrapAgent produces one run in your dashboard. Give it an agent name and an async function; the SDK generates a run_id, opens a tracing context, runs your function, captures every child span, and flushes the result.
Example
- Node.js
- Python
What you set vs what’s rolled up
| You set on the RunHandle | Auto-rolled from spans |
|---|---|
agentName, distinctId, conversationId | duration_ms (callback start → end) |
setInput / setOutput / setMetadata | total_tokens_in, total_tokens_out |
setErrorSummary | total_cost |
| — | span_count, tool_count, error_count |
| — | status (ok / error / running) |
total_tokens_in / total_tokens_out / total_cost are summed across every kind='llm' span inside the run.
Options
| Option (Node / Python) | Purpose |
|---|---|
agentName | Required. Free-text identifier — "support-bot", "ticket-triage-v2". |
distinctId / distinct_id | Your user id. Lets you filter runs per user. |
conversationId / conversation_id | Groups runs from the same chat thread. |
parentRunId / parent_run_id | Marks this run as a sub-agent. See Recipes → Sub-agents. |
metadata | Free-form JSON tags. Same as calling setMetadata up-front. |
Next
- Spans — what goes inside the callback.
- Recipes → Basic agent — runnable copy of this example.