Agents

Compare saved-test decisions (Preview)

Preview · Available to selected organizations. Runs saved tests against a supplied draft and the current immutable published definition, returning changed action decisions.

POST
/v1/agents/{id}/tests/rerun

Runs saved tests against a supplied draft and the current immutable published definition, returning changed action decisions. No test or agent is modified and nothing is sent. Large comparisons can time out; run saved tests individually or shorten their conversations before retrying.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^agt_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
name*AgentName
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length <= 120
definition*

Response Body

AgentTestRerun

application/json
  1. response
items*array<>
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.agents.rerunTests({  "id": "example",  "name": "example",  "definition": {    "instructions": "example",    "knowledge": "example",    "endpointIds": [      "example"    ],    "integrations": [      {        "integrationId": "example",        "tools": {          "kind": "all"        }      }    ],    "policy": {      "presets": [        "example"      ],      "rules": [        {          "match": {},          "decide": "run"        }      ]    },    "model": "standard",    "reasoning": "auto",    "workingHours": {      "timeZone": "example",      "ranges": [        {          "day": "monday",          "opens": "example",          "closes": "example"        }      ]    },    "takeoverTimeoutMinutes": 1  }});
Example Response
{  "items": [    {      "testId": "string",      "publishedDecisions": [        {          "actionIndex": 0,          "kind": "send",          "tool": "string",          "outcome": "allow",          "text": "string"        }      ],      "draftDecisions": [        {          "actionIndex": 0,          "kind": "send",          "tool": "string",          "outcome": "allow",          "text": "string"        }      ],      "changedDecisions": [        {          "actionIndex": 0,          "kind": "send",          "tool": "string",          "outcome": "allow",          "text": "string"        }      ]    }  ]}

Related documentation