OpenaiEx.Evals (openai_ex v0.9.22)

Copy Markdown View Source

This module provides an implementation of the OpenAI evals API. The API reference can be found at https://platform.openai.com/docs/api-reference/evals.

Summary

Functions

cancel_run(openai, eval_id, run_id)

cancel_run!(openai, eval_id, run_id)

Cancels a specific run for an evaluation.

See https://platform.openai.com/docs/api-reference/evals/cancelRun for more information.

create(openai, eval_request)

create!(openai, eval_request)

Calls the eval 'create' endpoint.

See https://platform.openai.com/docs/api-reference/evals/create for more information.

create_run(openai, eval_id, run_request)

create_run!(openai, eval_id, run_request)

Creates a new run for an evaluation.

See https://platform.openai.com/docs/api-reference/evals/createRun for more information.

delete(openai, eval_id)

delete!(openai, eval_id)

Calls the eval delete endpoint.

See https://platform.openai.com/docs/api-reference/evals/delete for more information.

delete_run(openai, eval_id, run_id)

delete_run!(openai, eval_id, run_id)

Deletes a specific run for an evaluation.

See https://platform.openai.com/docs/api-reference/evals/deleteRun for more information.

get_run(openai, eval_id, run_id)

get_run!(openai, eval_id, run_id)

Retrieves a specific run for an evaluation.

See https://platform.openai.com/docs/api-reference/evals/getRun for more information.

get_run_output_item(openai, eval_id, run_id, output_item_id)

get_run_output_item!(openai, eval_id, run_id, output_item_id)

Retrieves a specific output item for a run.

See https://platform.openai.com/docs/api-reference/evals/getRunOutputItem for more information.

get_runs(openai, eval_id)

get_runs!(openai, eval_id)

Lists all runs for a specific evaluation.

See https://platform.openai.com/docs/api-reference/evals/getRuns for more information.

list(openai, params \\ %{})

list!(openai, params \\ %{})

Lists all evals that belong to the user's organization.

See https://platform.openai.com/docs/api-reference/evals/list for more information.

list_run_output_items(openai, eval_id, run_id)

list_run_output_items!(openai, eval_id, run_id)

Lists all output items for a specific run.

See https://platform.openai.com/docs/api-reference/evals/listRunOutputItems for more information.

new(args)

Creates a new eval request

See https://platform.openai.com/docs/api-reference/evals/create for full list of request parameters.

Example usage:

iex> _request = OpenaiEx.Evals.new(name: "Sentiment")
%{name: "Sentiment"}

iex> _request = OpenaiEx.Evals.new(%{name: "Sentiment", testing_criteria: [%{type: "label_model", ...}]})
%{name: "Sentiment", testing_criteria: [%{type: "label_model", ...}]}

new_run(args)

Creates a new eval run request

See https://platform.openai.com/docs/api-reference/evals/createRun for full list of request parameters.

Example usage:

iex> _request = OpenaiEx.Evals.new_run(name: "gpt-4o-mini")
%{name: "gpt-4o-mini"}

iex> _request = OpenaiEx.Evals.new_run(%{name: "gpt-4o-mini", data_source: %{type: "completions", ...}})
%{name: "gpt-4o-mini", data_source: %{type: "completions", ...}}

update(openai, eval_id, eval_request)

update!(openai, eval_id, eval_request)

Calls the eval update endpoint.

See https://platform.openai.com/docs/api-reference/evals/update for more information.