VocalDocscontracts 1.65.0

Update a scenario

PATCH /v1/prompt-eval-suites/{prompt_eval_suite_id}/scenarios/{scenario_id}

PropertyValue
Operationupdate_prompt_eval_scenario
GroupPrompt evaluations and experiments
Scopeprompts:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited prompts.prompt_eval_scenario.update (mutation)
Released in1.55.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Replaces the named fields of a scenario at the revision If-Match names, checked as a creation is on the merged scenario (1.55.0); kind is fixed at create.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the prompts:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X PATCH "$VOCAL_API/v1/prompt-eval-suites/pes_.../scenarios/pesc_..." \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"' \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
prompt_eval_suite_idpathPromptEvalSuiteIdyesThe id of an evaluation suite: pes_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
scenario_idpathPromptEvalScenarioIdyesThe id of a scenario of an evaluation suite: pesc_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.

Request body

Content type application/json, required: PromptEvalScenarioUpdateRequest.

FieldTypeRequiredDescription
callerPromptEvalCallerInputno
expectationsarray of ConversationTestExpectationInputno
initial_slotsPromptEvalInitialSlotsnoThe starting slot values (1.63.0); {} clears them.
max_turnsintegernoThe most Turns a Call of the scenario takes before it is ended.
namestringnoA display name.
rubricarray of PromptEvalRubricItemInputno
tagsarray of PromptEvalTagno
tool_mocksarray of PromptEvalToolMockInputno
variablesPromptEvalVariablesno

Responses

StatusContent typeShapeError codes
200application/jsonPromptEvalScenario
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeprompt_eval_suite_archived
412application/jsonErrorEnveloperevision_mismatch
422application/jsonErrorEnvelopevalidation_failed
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is PromptEvalScenario.

FieldTypeRequiredDescription
callerPromptEvalCaller or nullyesThe caller, the content class text: null unless the read names include=text, and null in the answer of a write.
created_atTimestampyes
expectationsarray of ConversationTestExpectationyesThe expectations of a scripted scenario; empty otherwise.
idPromptEvalScenarioIdyes
initial_slotsPromptEvalInitialSlotsnoThe starting slot values (1.63.0); absent from an api before 1.63.0, which a reader treats as none.
kindPromptEvalScenarioKindyes
max_turnsintegeryesThe most Turns a Call of the scenario takes before it is ended.
namestringyesA display name.
object"prompt_eval_scenario"yes
revisionintegeryesCounts writes; returned as the ETag and required in If-Match.
rubricarray of PromptEvalRubricItemyesThe rubric of a simulated scenario; empty otherwise.
suite_idPromptEvalSuiteIdyes
tagsarray of PromptEvalTagyes
tool_mocksarray of PromptEvalToolMockyes
updated_atTimestampyes
variablesPromptEvalVariablesyes