Skip to Content
Eval suites

Create an eval scenario

Permissioneval-suites:updateAdd-onEvaluationsRetriesIdempotency-Key requiredAuthentication
POST
/eval-suites/{id}/scenarios

Adds one active scenario to a suite. slug is immutable and unique within the suite. The complete encoded request body is limited to 327680 bytes; assertions is an optional JSON object limited to 262144 encoded bytes and interpreted by the eval worker.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Path Parameters

id*string
Formatuuid

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
slug*string
Match^[a-z0-9_]{2,64}$
Length2 <= length <= 64
label?string

Limited to 200 UTF-8 encoded bytes; maxLength is a generator hint.

Lengthlength <= 200
Default""
persona_text*string

Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint.

Length1 <= length <= 20000
scenario_text*string

Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint.

Length1 <= length <= 20000
assertions?|

Optional assertion object limited to 262144 encoded bytes.

Response Body

Scenario created with a strong ETag.

application/json
  1. response
id*string
Formatuuid
slug*string

Stable stored handle. Historical compatibility rows predate the public create regex, so readers must not infer a character pattern.

Length1 <= length
label*string

Limited to 200 UTF-8 encoded bytes; maxLength is a generator hint.

Lengthlength <= 200
persona_text*string

Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint.

Lengthlength <= 20000
scenario_text*string

Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint.

Lengthlength <= 20000
assertions*|

Stored assertion object; scenario mutation inputs are limited to 262144 encoded bytes.

source*string
Value in"manual""generated"
generation_job_id*|
Formatuuid
position*integer
Range0 <= value
version*integer
Formatint64
Range1 <= value
archived_at*|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.kejue.co/v1/eval-suites/497f6eca-6276-4993-bfeb-53cbbbba6f08/scenarios' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "slug": "string",  "persona_text": "string",  "scenario_text": "string"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "slug": "string",  "label": "string",  "persona_text": "string",  "scenario_text": "string",  "assertions": {},  "source": "manual",  "generation_job_id": "cbb45fb9-5d30-40f9-8e81-176f4e856bb3",  "position": 0,  "version": 1,  "archived_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}