agent_config(), it traces for you: see All frameworks. Call decimalai.init() first. Until then your code runs as normal and nothing is sent.
@decimalai.trace()
Traces a function as one run. A string first argument is recorded as the run’s input and a string return value as its output, the first 200 characters of each.
It wraps a regular function. An
async def returns its coroutine at once, so the trace ends before your code runs: open the run with start_trace inside the coroutine.
decimalai.start_trace()
A context manager that opens a run. It takes @trace’s parameters, plus skills and skill_dirs for the manifest’s skill list (left out, the SDK reads your project’s skill folders). An exception in the block marks the trace as an error and is re-raised.
ctx also has log_llm_call, log_tool_call, set_input(text), set_output(text) (200 characters kept) and get_trace_id(), the id to pass as a child run’s parent_trace_id.
decimalai.log_llm_call()
Records one model call on the current trace. Outside a trace it raises DecimalConfigError.
decimalai.log_tool_call()
Records one tool call on the current trace. Outside a trace it raises DecimalConfigError.
name is required. status is "success" (default), "error", "partial" or "running".
@decimalai.tool
Registers a function’s name, docstring and parameter types in the agent’s manifest, so the regression check sees when a tool’s schema changes. The function runs unchanged and calling it records nothing: log calls with log_tool_call.
@decimalai.tool(name="flights") registers it under another name.
Mark where a run begins and ends
With a direct provider flag (anthropic=True, openai=True, google=True), say where a run begins yourself. A provider instrumentor sees one SDK call at a time, so a tool-use loop of two messages.create() calls arrives as two unrelated traces.
support-bot. The name belongs to the block, so concurrent runs stay separate, and an inner agent_run is a child span, not a second trace. The other parameters are span_name, attributes and tracer_provider, for an exporter on a provider other than the global one.
A run’s skills reach its trace through this span. Without it, a raw-provider run carries no routing_id and no offered skill names: the SDK won’t guess which run a decision belonged to. Framework adapters wrap their own runs, and on Pydantic AI agent_config()’s capability opens the run span. A Pydantic AI agent traced by a provider flag alone needs agent_run. For several LlamaIndex agents in one process, see OpenTelemetry.