SDK reference · Python SDK

prov.trace.traces.inferences

prov.trace.traces.inferences in Python SDK.

Signature

prov.trace.traces.inferences(limit: Optional[int] = …) -> Any

Parameters

limitOptional[int]

Request fields

limitintegerquery
The most items to return, from 1 to 100. The default is 20.
qstringquery
Only inferences whose trace ID, prompt key or model version contains this text (not case-sensitive).
model_versionstringquery
Only inferences on these model versions, as a comma-separated list.
canaryenumquery
tripped for inferences where a canary family tripped, clear for the rest. One of tripped, clear.
created_gtetimestampquery
Only inferences created at or after this time.
created_ltetimestampquery
Only inferences created at or before this time.

Returns

Any The traced inferences, newest first.

HTTP operation

GET /v1/trace/inferences: List traced inferences

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/chat/completions`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "model": "qwen2.5-0.5b-instruct",
    "max_tokens": 40,
    "temperature": 0,
    "messages": [
      {
        "role": "system",
        "content": "You are a payments assistant for Northwind. Be brief."
      },
      {
        "role": "user",
        "content": "Summarize this vendor email: 'Hi team, the October invoice is attached. The total is $1,240 and payment terms are net 30.'"
      }
    ],
    "provenance": {
      "retain": true
    }
  }),
})).json();
const traceId = step1.provenance.trace_id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/inferences?limit=1`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.