dynamo_async_openai/types/model.rs
1// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Based on https://github.com/64bit/async-openai/ by Himanshu Neema
5// Original Copyright (c) 2022 Himanshu Neema
6// Licensed under MIT License (see ATTRIBUTIONS-Rust.md)
7//
8// Modifications Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES.
9// Licensed under Apache 2.0
10
11use serde::{Deserialize, Serialize};
12
13/// Describes an OpenAI model offering that can be used with the API.
14#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
15pub struct Model {
16 /// The model identifier, which can be referenced in the API endpoints.
17 pub id: String,
18 /// The object type, which is always "model".
19 pub object: String,
20 /// The Unix timestamp (in seconds) when the model was created.
21 pub created: u32,
22 /// The organization that owns the model.
23 pub owned_by: String,
24}
25
26#[derive(Debug, Deserialize, Clone, PartialEq, Serialize)]
27pub struct ListModelResponse {
28 pub object: String,
29 pub data: Vec<Model>,
30}
31
32#[derive(Debug, Deserialize, Clone, PartialEq, Serialize)]
33pub struct DeleteModelResponse {
34 pub id: String,
35 pub object: String,
36 pub deleted: bool,
37}