openai-interface 0.13.0

A low-level Rust interface for the OpenAI API
Documentation
//! The Evals API: manage evaluation runs via `/evals`.
//!
//! > ![warn] This module is untested!
//! > If you encounter any issues, please report them on the repository.
//!
//! An eval is a task used to measure the quality of a model's outputs
//! against a data source of test cases. See
//! [the OpenAI Evals guide](https://platform.openai.com/docs/guides/evals).
//!
//! Submodules: [`create`], [`retrieve`], [`update`], [`delete`],
//! [`list`] and [`runs`] (per-eval run management, including the run
//! output items sub-resource).

pub mod create;
pub mod delete;
pub mod list;
pub mod retrieve;
pub mod runs;
pub mod update;

/// An eval object.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Eval {
    /// The eval ID, e.g. `eval_...`.
    pub id: String,
    /// The object type, always `eval`.
    #[serde(default)]
    pub object: Option<String>,
    /// Unix timestamp (seconds) of when the eval was created.
    #[serde(default)]
    pub created_at: Option<u64>,
    /// The configuration of the eval (testing criteria, data source),
    /// as raw JSON.
    #[serde(default)]
    pub data_source_config: Option<serde_json::Value>,
    /// The testing criteria applied by the eval, as raw JSON.
    #[serde(default)]
    pub testing_criteria: Option<Vec<serde_json::Value>>,
    /// The name of the eval.
    #[serde(default)]
    pub name: Option<String>,
    /// Arbitrary key-value metadata attached to the eval.
    #[serde(default)]
    pub metadata: Option<std::collections::HashMap<String, String>>,
}

crate::impl_from_str!(Eval);