Create evaluator
Creates a new evaluator with an initial version.
Payload Requirements
- The evaluator name must be unique within the given space.
- type (top-level) selects the evaluator kind: TEMPLATE or CODE. With TEMPLATE, provide version.template_config. With CODE, provide version.code_config — where code_config.type is MANAGED or CUSTOM (a separate discriminator within code_config, independent of the top-level type: CODE).
- For template evaluators: version.template_config.name is the eval column name; must match ^[a-zA-Z0-9_\s\-&()]+$.
- For template evaluators: version.template_config.template is the prompt template; use {variable} for placeholders (f-string format, e.g. {input}, {output}).
- For template evaluators: version.template_config.classification_choices is required and maps choice labels to numeric scores (e.g. {"relevant": 1, "irrelevant": 0}).
- For code evaluators: see CodeConfig — managed evaluators (code_config.type: MANAGED) use managed_evaluator and variables; custom evaluators (code_config.type: CUSTOM) use code, optional imports, and variables.
- System-managed fields (id, created_at, updated_at, created_by_user_id) are rejected on input.
Valid example (template evaluator)
{
"name": "Hallucination Detector",
"space_id": "U3BhY2U6MTpWNEth",
"type": "TEMPLATE",
"version": {
"commit_message": "Initial version",
"template_config": {
"name": "hallucination",
"template": "Given the input: {input}\nand the output: {output}\nIs the output a hallucination?",
"include_explanations": true,
"use_function_calling": true,
"classification_choices": {"hallucinated": 0, "factual": 1},
"llm_config": {
"ai_integration_id": "TGxtSW50ZWdyYXRpb246MTI6YUJjRA==",
"model_name": "gpt-4o",
"invocation_parameters": {"temperature": 0},
"provider_parameters": {}
}
}
}
}
Invalid example (type/config mismatch — TEMPLATE type with code_config)
{
"name": "Bad Evaluator",
"space_id": "U3BhY2U6MTpWNEth",
"type": "TEMPLATE",
"version": {
"commit_message": "Wrong config",
"code_config": {
"type": "CUSTOM",
"name": "my_eval",
"code": "class Evaluator: ...",
"variables": ["input"]
}
}
}
<Note>This endpoint is in beta, read more here.</Note>
Request body
Response
Returns an evaluator with a resolved version
Changes
Changed in 4 of the 16 revisions of this API.867
- ○
added the optional property
allOf[subschema #2]/version/oneOf[EvaluatorVersionTemplate]/allOf[subschema #2]/template_config/llm_config/invocation_parameters/service_tierto the response with the201statusresponse-optional-property-added
- ○
- ▲
added the new required request property
version/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/use_function_callingnew-required-request-property
- ▲
removed the required property
allOf[subschema #2]/version/oneOf[EvaluatorVersionTemplate]/allOf[subschema #2]/template_config/use_function_calling_if_availablefrom the response with the201statusresponse-required-property-removed
- ●
removed the request property
version/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/use_function_calling_if_availablerequest-property-removed
- ○
added the optional property
allOf[subschema #2]/version/oneOf[EvaluatorVersionTemplate]/allOf[subschema #2]/template_config/use_function_callingto the response with the201statusresponse-optional-property-added
- ▲
- ▲
added
ToolConfigRequestto theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/invocation_parameters/tool_configrequest propertyallOflistrequest-property-all-of-added
- ●
removed
ToolConfigfrom theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/invocation_parameters/tool_configrequest propertyallOflistrequest-property-all-of-removed
- ▲
- ▲
added
AnthropicHeadersRequestto theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/provider_parameters/anthropic_headersrequest propertyallOflistrequest-property-all-of-added
- ▲
added
AzureParamsRequestto theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/provider_parameters/azure_paramsrequest propertyallOflistrequest-property-all-of-added
- ▲
added
BedrockOptionsRequestto theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/provider_parameters/bedrock_optionsrequest propertyallOflistrequest-property-all-of-added
- ▲
added
ResponseFormatRequestto theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/invocation_parameters/response_formatrequest propertyallOflistrequest-property-all-of-added
- ▲
removed
ManagedCodeConfigCustomCodeConfigfrom theversion/oneOf[CreateCodeEvaluatorVersionRequest]/code_configrequest propertyoneOflistrequest-property-one-of-removed
- ●
removed
AnthropicHeadersfrom theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/provider_parameters/anthropic_headersrequest propertyallOflistrequest-property-all-of-removed
- ●
removed
AzureParamsfrom theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/provider_parameters/azure_paramsrequest propertyallOflistrequest-property-all-of-removed
- ●
removed
BedrockOptionsfrom theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/provider_parameters/bedrock_optionsrequest propertyallOflistrequest-property-all-of-removed
- ●
removed
ResponseFormatfrom theversion/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/llm_config/invocation_parameters/response_formatrequest propertyallOflistrequest-property-all-of-removed
- ○
the request property
version/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/classification_choicesbecame nullablerequest-property-became-nullable
- ○
the request property
version/oneOf[CreateTemplateEvaluatorVersionRequest]/template_config/classification_choicesbecame optionalrequest-property-became-optional
- ○
mapped value for discriminator key
CUSTOMchanged fromCustomCodeConfigtoCustomCodeConfigRequestforversion/oneOf[CreateCodeEvaluatorVersionRequest]/code_configrequest propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
MANAGEDchanged fromManagedCodeConfigtoManagedCodeConfigRequestforversion/oneOf[CreateCodeEvaluatorVersionRequest]/code_configrequest propertyrequest-property-discriminator-mapping-changed
- ○
added
ManagedCodeConfigRequestCustomCodeConfigRequestto theversion/oneOf[CreateCodeEvaluatorVersionRequest]/code_configrequest propertyoneOflistrequest-property-one-of-added
- ▲
Of the 16 revisions, 1 has no diff computed.