openai_compat/types/
models.rs1use serde::{Deserialize, Serialize};
4
5use crate::pagination::HasId;
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
9#[non_exhaustive]
10pub struct Model {
11 pub id: String,
12 #[serde(default)]
13 pub created: Option<i64>,
14 #[serde(default)]
15 pub object: String,
16 #[serde(default)]
17 pub owned_by: Option<String>,
18}
19
20impl HasId for Model {
21 fn id(&self) -> Option<&str> {
22 Some(&self.id)
23 }
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
28#[non_exhaustive]
29pub struct Deleted {
30 pub id: String,
31 pub deleted: bool,
32 #[serde(default)]
33 pub object: String,
34}