SDK reference · Node SDK

prov.trace.patterns.delete

prov.trace.patterns.delete in Node SDK.

Signature

prov.trace.patterns.delete(patternId: string): Promise<{ id: string; object: "pattern"; deleted: true }>

Parameters

patternIdstringRequired

Returns

Promise<{ id: string; object: "pattern"; deleted: true }> The deleted pattern.

HTTP operation

DELETE /v1/trace/patterns/{id}: Delete a pattern

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/patterns`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Wire instructions in late layers",
    "description": "A wire-transfer label active past layer 12, with the injection family tripped.",
    "definition": {
      "match": "all",
      "rules": [
        {
          "kind": "family",
          "family": "prompt_injection"
        },
        {
          "kind": "activation",
          "min": 1.5,
          "layers": [
            12,
            23
          ]
        }
      ]
    }
  }),
})).json();
const patternId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/patterns/${patternId}`, {
  method: "DELETE",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.