Skip to main content

async_openai/types/models/
model.rs

1use serde::{Deserialize, Serialize};
2
3/// Describes an OpenAI model offering that can be used with the API.
4#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
5pub struct Model {
6    /// The model identifier, which can be referenced in the API endpoints.
7    pub id: String,
8    /// The object type, which is always "model".
9    pub object: String,
10    /// The Unix timestamp (in seconds) when the model was created.
11    pub created: u32,
12    /// The organization that owns the model.
13    pub owned_by: String,
14    /// The date when the model will shut down, or null if not announced.
15    #[serde(skip_serializing_if = "Option::is_none")]
16    pub shutdown_date: Option<String>,
17}
18
19#[derive(Debug, Deserialize, Clone, PartialEq, Serialize)]
20pub struct ListModelResponse {
21    pub object: String,
22    pub data: Vec<Model>,
23}
24
25#[derive(Debug, Deserialize, Clone, PartialEq, Serialize)]
26pub struct DeleteModelResponse {
27    pub id: String,
28    pub object: String,
29    pub deleted: bool,
30}