openai_rust/
models.rs

1//! See <https://platform.openai.com/docs/api-reference/models>.
2//! Use with [Client::list_models](crate::Client::list_models).
3use serde::Deserialize;
4
5#[derive(Deserialize, Debug)]
6pub(crate) struct ListModelsResponse {
7    pub data: Vec<Model>,
8}
9
10/// Describes an OpenAI model offering that can be used with the API.
11#[derive(Deserialize, Debug)]
12pub struct Model {
13    /// The model identifier, which can be referenced in the API endpoints.
14    pub id: String,
15    /// The organization that owns the model.
16    pub owned_by: String,
17    /// The Unix timestamp (in seconds) when the model was created.
18    pub created: u64,
19}
20
21// /// Permissions of a model
22// #[derive(Deserialize, Debug)]
23// pub struct ModelPermission {
24//     pub id: String,
25//     pub created: u32,
26//     pub allow_create_engine: bool,
27//     pub allow_sampling: bool,
28//     pub allow_logprobs: bool,
29//     pub allow_search_indices: bool,
30//     pub allow_view: bool,
31//     pub allow_fine_tuning: bool,
32//     pub organization: String,
33//     pub group: Option<String>,
34//     pub is_blocking: bool,
35// }