SDK reference · Node SDK
prov.trace.canarySets.update
prov.trace.canarySets.update in Node SDK. Replace members (version + 1, validation reset) and/or the description.
Signature
prov.trace.canarySets.update(setId: string, params: { members?: TraceCanaryMember[]; description?: string | null }): Promise<TraceCanarySet>Parameters
setIdstringRequiredparams{ members?: TraceCanaryMember[]; description?: string | null }Required
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
Promise<TraceCanarySet> The canary set.
HTTP operation
PATCH /v1/trace/canary_sets/{id}: Update a canary set
Errors
- authentication_required
- invalid_json
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- resource_missing
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();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/trace/canary_sets", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"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()
set_id = step1["id"]
data = httpx.patch(f"{api}/v1/trace/canary_sets/{set_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"description": "Members picked from the wire-fraud eval set"
}).json()