Skip to main content

openai_interface/evals/
mod.rs

1//! The Evals API: manage evaluation runs via `/evals`.
2//!
3//! > ![warn] This module is untested!
4//! > If you encounter any issues, please report them on the repository.
5//!
6//! An eval is a task used to measure the quality of a model's outputs
7//! against a data source of test cases. See
8//! [the OpenAI Evals guide](https://platform.openai.com/docs/guides/evals).
9//!
10//! Submodules: [`create`], [`retrieve`], [`update`], [`delete`],
11//! [`list`] and [`runs`] (per-eval run management, including the run
12//! output items sub-resource).
13
14pub mod create;
15pub mod delete;
16pub mod list;
17pub mod retrieve;
18pub mod runs;
19pub mod update;
20
21/// An eval object.
22#[derive(Debug, Clone, serde::Deserialize)]
23pub struct Eval {
24    /// The eval ID, e.g. `eval_...`.
25    pub id: String,
26    /// The object type, always `eval`.
27    #[serde(default)]
28    pub object: Option<String>,
29    /// Unix timestamp (seconds) of when the eval was created.
30    #[serde(default)]
31    pub created_at: Option<u64>,
32    /// The configuration of the eval (testing criteria, data source),
33    /// as raw JSON.
34    #[serde(default)]
35    pub data_source_config: Option<serde_json::Value>,
36    /// The testing criteria applied by the eval, as raw JSON.
37    #[serde(default)]
38    pub testing_criteria: Option<Vec<serde_json::Value>>,
39    /// The name of the eval.
40    #[serde(default)]
41    pub name: Option<String>,
42    /// Arbitrary key-value metadata attached to the eval.
43    #[serde(default)]
44    pub metadata: Option<std::collections::HashMap<String, String>>,
45}
46
47crate::impl_from_str!(Eval);