openai_rust2/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#[allow(dead_code)]
6#[derive(Deserialize, Debug)]
7pub(crate) struct ListModelsResponse {
8 pub data: Vec<Model>,
9}
10
11/// Describes an OpenAI model offering that can be used with the API.
12#[derive(Deserialize, Debug)]
13pub struct Model {
14 /// The model identifier, which can be referenced in the API endpoints.
15 pub id: String,
16 /// The organization that owns the model.
17 pub owned_by: String,
18 /// The Unix timestamp (in seconds) when the model was created.
19 pub created: u64,
20}
21
22// /// Permissions of a model
23// #[derive(Deserialize, Debug)]
24// pub struct ModelPermission {
25// pub id: String,
26// pub created: u32,
27// pub allow_create_engine: bool,
28// pub allow_sampling: bool,
29// pub allow_logprobs: bool,
30// pub allow_search_indices: bool,
31// pub allow_view: bool,
32// pub allow_fine_tuning: bool,
33// pub organization: String,
34// pub group: Option<String>,
35// pub is_blocking: bool,
36// }