Skip to main content

runs

Creates, updates, deletes, gets or lists a runs resource.

Overview

Nameruns
TypeResource
Idopenai.evals.runs

Fields

The following fields are returned by SELECT queries:

The evaluation run

NameDatatypeDescription
idstringUnique identifier for the evaluation run.
namestringThe name of the evaluation run.
eval_idstringThe identifier of the associated evaluation.
created_atinteger (unixtime)Unix timestamp (in seconds) when the evaluation run was created.
data_sourceobjectInformation about the run's data source. (title: JsonlRunDataSource)
errorobjectAn object representing an error response from the Eval API. (title: EvalApiError)
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)
modelstringThe model that is evaluated, if applicable.
objectstringThe type of the object. Always "eval.run". (eval.run) (default: eval.run)
per_model_usagearrayUsage statistics for each model during the evaluation run.
per_testing_criteria_resultsarrayResults per testing criteria applied during the evaluation run.
report_urlstring (uri)The URL to the rendered evaluation run report on the UI dashboard.
result_countsobjectCounters summarizing the outcomes of the evaluation run.
statusstringThe status of the evaluation run.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecteval_id, run_idopenai-organization, openai-project
listselecteval_idafter, limit, order, status, openai-organization, openai-project
createinserteval_id, data_sourceopenai-organization, openai-project
deletedeleteeval_id, run_idopenai-organization, openai-project
cancelexeceval_id, run_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 whose run you want to cancel.
run_idstringThe ID of the run to cancel.
afterstringIdentifier for the last run from the previous pagination request.
limitintegerNumber of runs 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 runs by timestamp. Use asc for ascending order or desc for descending order. Defaults to asc.
statusstringFilter runs by status. One of queued | in_progress | failed | completed | canceled.

SELECT examples

The evaluation run

SELECT
id,
name,
eval_id,
created_at,
data_source,
error,
metadata,
model,
object,
per_model_usage,
per_testing_criteria_results,
report_url,
result_counts,
status
FROM openai.evals.runs
WHERE eval_id = '{{ eval_id }}' -- required
AND run_id = '{{ run_id }}' -- required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;

INSERT examples

No description available.

INSERT INTO openai.evals.runs (
name,
metadata,
data_source,
eval_id,
"openai-organization",
"openai-project"
)
SELECT
'{{ name }}',
'{{ metadata }}',
'{{ data_source }}' /* required */,
'{{ eval_id }}',
'{{ openai-organization }}',
'{{ openai-project }}'
RETURNING
id,
name,
eval_id,
created_at,
data_source,
error,
metadata,
model,
object,
per_model_usage,
per_testing_criteria_results,
report_url,
result_counts,
status
;

DELETE examples

No description available.

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

Lifecycle Methods

The canceled eval run object

EXEC openai.evals.runs.cancel
@eval_id='{{ eval_id }}' --required,
@run_id='{{ run_id }}' --required,
@openai-organization='{{ openai-organization }}',
@openai-project='{{ openai-project }}'
;