Skip to main content

evals

Creates, updates, deletes, gets or lists an evals resource.

Overview​

Nameevals
TypeResource
Idopenai.evals.evals

Fields​

The following fields are returned by SELECT queries:

The evaluation

NameDatatypeDescription
idstringUnique identifier for the evaluation.
namestringThe name of the evaluation. (example: Chatbot effectiveness Evaluation)
created_atinteger (unixtime)The Unix timestamp (in seconds) for when the eval was created.
data_source_configobjectConfiguration of data sources used in runs of the evaluation. (title: CustomDataSourceConfig)
metadataobjectSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. (x-oaiTypeLabel: map)
objectstringThe object type. (eval) (default: eval)
testing_criteriaarrayA list of testing criteria. (default: eval)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecteval_idopenai-organization, openai-project
listselectafter, limit, order, order_by, openai-organization, openai-project
createinsertdata_source_config, testing_criteriaopenai-organization, openai-project
updateupdateeval_idopenai-organization, openai-project
deletedeleteeval_idopenai-organization, openai-project

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
eval_idstringThe ID of the evaluation to delete.
afterstringIdentifier for the last eval from the previous pagination request.
limitintegerNumber of evals to retrieve. Automatically applied from a SQL LIMIT clause - SELECT ... LIMIT 10 sends limit=10 on the wire. Setting it explicitly in a WHERE clause is not required.
openai-organizationstringOptionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization.
openai-projectstringOptionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project.
orderstringSort order for evals by timestamp. Use asc for ascending order or desc for descending order.
order_bystringEvals can be ordered by creation time or last updated time. Use created_at for creation time or updated_at for last updated time.

SELECT examples​

The evaluation

SELECT
id,
name,
created_at,
data_source_config,
metadata,
object,
testing_criteria
FROM openai.evals.evals
WHERE eval_id = '{{ eval_id }}' -- required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;

INSERT examples​

No description available.

INSERT INTO openai.evals.evals (
name,
metadata,
data_source_config,
testing_criteria,
"openai-organization",
"openai-project"
)
SELECT
'{{ name }}',
'{{ metadata }}',
'{{ data_source_config }}' /* required */,
'{{ testing_criteria }}' /* required */,
'{{ openai-organization }}',
'{{ openai-project }}'
RETURNING
id,
name,
created_at,
data_source_config,
metadata,
object,
testing_criteria
;

UPDATE examples​

No description available.

UPDATE openai.evals.evals
SET
name = '{{ name }}',
metadata = '{{ metadata }}'
WHERE
eval_id = '{{ eval_id }}' --required
AND "openai-organization" = '{{ openai-organization}}'
AND "openai-project" = '{{ openai-project}}'
RETURNING
id,
name,
created_at,
data_source_config,
metadata,
object,
testing_criteria;

DELETE examples​

No description available.

DELETE FROM openai.evals.evals
WHERE eval_id = '{{ eval_id }}' --required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;