1use serde::Deserialize;
2
3use crate::{client::Client, result::Result};
4
5#[derive(Deserialize, Debug)]
6pub struct ModelListResponse {
7 pub data: Vec<ModelResponse>,
8 pub object: String,
9}
10
11#[derive(Deserialize, Debug)]
12pub struct ModelResponse {
13 pub id: String,
14 pub object: String,
15 pub owned_by: String,
16}
17
18pub struct Models {
19 client: Client,
20}
21
22impl Models {
23 pub fn new(client: Client) -> Self {
24 Models { client }
25 }
26
27 pub async fn list(self) -> Result<ModelListResponse> {
28 self.client.get("/models").await
29 }
30}