createEvalSet mutation creates an evaluation set in a domain. It requires the evaluation:write permission.
Signature
createEvalSet(input: CreateEvalSetInput!): EvalSet!
CreateEvalSetInput fields:
| Field | Type | Description |
|---|---|---|
name | String! | The name of the evaluation set. |
domainId | String! | The domain the evaluation set belongs to. |
items | [[PromptSQLPairInput!]!]! | The sessions. Each session is an ordered list of turns, so you can create multi-turn cases. See PromptSQLPair. |
draftId | ID | A draft of the domain. The set is staged on the draft and goes live when you publish the draft. |
customGradingInstructions | String | Grading instructions for the whole set. |
Example
mutation CreateEvalSet($input: CreateEvalSetInput!) {
createEvalSet(input: $input) {
id
name
version
caseIds
}
}
Variables
{
"input": {
"name": "Revenue questions",
"domainId": "domain_987654321",
"items": [
[
{
"prompt": "What is the total revenue for closed won opportunities?",
"sql": ["SELECT SUM(amount) FROM Opportunity WHERE stage = 'Closed Won'"]
},
{
"prompt": "Break that down by region.",
"sql": ["SELECT region, SUM(amount) FROM Opportunity WHERE stage = 'Closed Won' GROUP BY region"],
"assertions": [{ "criterion": "Breaks revenue down by region" }]
}
]
]
}
}
Response
{
"data": {
"createEvalSet": {
"id": "eval_set_123",
"name": "Revenue questions",
"version": 1,
"caseIds": ["case_001"]
}
}
}