Read a scenario
GET /v1/prompt-eval-suites/{prompt_eval_suite_id}/scenarios/{scenario_id}
| Property | Value |
|---|---|
| Operation | get_prompt_eval_scenario |
| Group | Prompt evaluations and experiments |
| Scope | prompts:read |
Scopes of include values | text needs prompts:read |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | An audited content read prompts.prompt_eval_scenario.read, when the request names an include value |
| Released in | 1.55.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Answers one scenario with its revision as the ETag (1.55.0); caller is null unless include=text adds it, which makes the read an audited content read.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the prompts:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl "$VOCAL_API/v1/prompt-eval-suites/pes_.../scenarios/pesc_..." \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/prompt-eval-suites/pes_.../scenarios/pesc_...`, {
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.get(
f"{os.environ['VOCAL_API']}/v1/prompt-eval-suites/pes_.../scenarios/pesc_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
prompt_eval_suite_id | path | PromptEvalSuiteId | yes | The id of an evaluation suite: pes_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
scenario_id | path | PromptEvalScenarioId | yes | The id of a scenario of an evaluation suite: pesc_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
include | query | array of PromptEvalScenarioInclude | no | Content classes to add, comma-separated: text answers caller and makes the read an audited content read (1.55.0). |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | PromptEvalScenario | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
404 | application/json | ErrorEnvelope | not_found |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is PromptEvalScenario.
| Field | Type | Required | Description |
|---|---|---|---|
caller | PromptEvalCaller or null | yes | The caller, the content class text: null unless the read names include=text, and null in the answer of a write. |
created_at | Timestamp | yes | |
expectations | array of ConversationTestExpectation | yes | The expectations of a scripted scenario; empty otherwise. |
id | PromptEvalScenarioId | yes | |
initial_slots | PromptEvalInitialSlots | no | The starting slot values (1.63.0); absent from an api before 1.63.0, which a reader treats as none. |
kind | PromptEvalScenarioKind | yes | |
max_turns | integer | yes | The most Turns a Call of the scenario takes before it is ended. |
name | string | yes | A display name. |
object | "prompt_eval_scenario" | yes | |
revision | integer | yes | Counts writes; returned as the ETag and required in If-Match. |
rubric | array of PromptEvalRubricItem | yes | The rubric of a simulated scenario; empty otherwise. |
suite_id | PromptEvalSuiteId | yes | |
tags | array of PromptEvalTag | yes | |
tool_mocks | array of PromptEvalToolMock | yes | |
updated_at | Timestamp | yes | |
variables | PromptEvalVariables | yes |