SDK reference · Python SDK

prov.trace.canary_sets.update

prov.trace.canary_sets.update in Python SDK.

Signature

prov.trace.canary_sets.update(set_id: str, members: Optional[list] = …, description: Optional[str] = …) -> Any

Parameters

set_idstrRequired
membersOptional[list]
descriptionOptional[str]

Request fields

idstringpathRequired
The canary set's ID.
membersarray of objects
The neurons in the canary set, each with its trip threshold.
descriptionstring | null
A longer description.

Returns

Any The canary set.

HTTP operation

PATCH /v1/trace/canary_sets/{id}: Update a canary set

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/canary_sets`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "family": "refund_fraud",
    "model": "qwen2.5-0.5b-instruct@7ae55760",
    "members": [
      {
        "layer": 16,
        "idx": 1495,
        "pole": "pos",
        "threshold": 11
      }
    ],
    "card": {
      "title": "Refund fraud",
      "definition": "Text that pushes the agent to refund an order that wasn't returned.",
      "may_indicate": [
        "A message claims a return that never shipped"
      ]
    }
  }),
})).json();
const setId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/canary_sets/${setId}`, {
  method: "PATCH",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "description": "Members picked from the wire-fraud eval set" }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.