Create Eval
Create a new eval using an eval type configuration.
Args: eval_request (Eval): Data for the eval to create, including eval type and configuration.
Returns: Eval: The created eval object.
Raises: AymaraAPIError: If the workspace is not found or the request is invalid.
Example: POST /api/evals { "eval_type": "...", "workspace_uuid": "...", ... }
Body
Required
-
Description of the AI under evaluation.
-
Type of the eval (safety, accuracy, etc.)
-
Default value is
en
. -
Content type for AI interactions.
Values are
text
orimage
. Default value istext
. -
Default value is
100
. -
Indicates if the eval is a jailbreak test.
Default value is
false
. -
Indicates if the eval results are sandboxed.
Default value is
false
. -
Resource status.
Values are
created
,processing
,finished
, orfailed
.
import os
from aymara_ai import AymaraAI
client = AymaraAI(
api_key=os.environ.get("AYMARA_AI_API_KEY"), # This is the default and can be omitted
)
eval = client.evals.create(
ai_description="ai_description",
eval_type="eval_type",
)
print(eval.eval_uuid)
curl \
--request POST 'https://api.aymara.ai/v2/evals' \
--header "x-api-key: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"eval_uuid":"string","name":"string","ai_description":"string","ai_instructions":"string","eval_type":"string","eval_instructions":"string","language":"en","modality":"text","ground_truth":"string","num_prompts":100,"prompt_examples":[{"content":"string","example_uuid":"string","type":"good","explanation":"string"}],"is_jailbreak":false,"is_sandbox":false,"workspace_uuid":"string","status":"created","created_at":"2025-05-04T09:42:00Z","updated_at":"2025-05-04T09:42:00Z"}'
{
"eval_uuid": "string",
"name": "string",
"ai_description": "string",
"ai_instructions": "string",
"eval_type": "string",
"eval_instructions": "string",
"language": "en",
"modality": "text",
"ground_truth": "string",
"num_prompts": 100,
"prompt_examples": [
{
"content": "string",
"example_uuid": "string",
"type": "good",
"explanation": "string"
}
],
"is_jailbreak": false,
"is_sandbox": false,
"workspace_uuid": "string",
"status": "created",
"created_at": "2025-05-04T09:42:00Z",
"updated_at": "2025-05-04T09:42:00Z"
}
{
"eval_uuid": "string",
"name": "string",
"ai_description": "string",
"ai_instructions": "string",
"eval_type": "string",
"eval_instructions": "string",
"language": "en",
"modality": "text",
"ground_truth": "string",
"num_prompts": 100,
"prompt_examples": [
{
"content": "string",
"example_uuid": "string",
"type": "good",
"explanation": "string"
}
],
"is_jailbreak": false,
"is_sandbox": false,
"workspace_uuid": "string",
"status": "created",
"created_at": "2025-05-04T09:42:00Z",
"updated_at": "2025-05-04T09:42:00Z"
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}