SDK reference · Python SDK

prov.trace.labels.create

prov.trace.labels.create in Python SDK. Label neurons of a trace you opened (Pro and up).

Signature

prov.trace.labels.create(trace_id: str, neurons: list[str]) -> Any

Parameters

trace_idstrRequired
neuronslist[str]Required

Request fields

idstringpathRequired
The trace's ID.
neuronsarray of stringsRequired
Neuron IDs from the trace's graph (L<layer>.<idx>.<pole>), at most 20 per request by default.

Returns

Any One item per neuron named: labelled (new, billed), cached (yours already, free), masked, not_in_trace, no_examples (the registry has no examples for it) or error (the labeller failed for it; not billed). credits is what this request billed.

HTTP operation

POST /v1/trace/traces/{id}/labels: Label neurons in a trace

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/traces/trc_b9a77ee9e4b8ac4ae4335862ce6bdf85/labels`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "neurons": ["L13.1053.pos", "L20.648.neg"] }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.