Skip to content

Commit

Permalink
Make suitable for an engine which only returns ONE model in the list.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMcCulloch committed Feb 26, 2024
1 parent 48d18e0 commit e83bb55
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion async-openai/src/types/model.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
use serde::{Deserialize, Serialize};
/// Describes an OpenAI model offering that can be used with the API.
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
pub struct ModelStats {
pub queue_fraction: f32,
pub queue_absolute: u32,
pub results_pending: u32,
pub batch_size: u32,
}

/// Describes an OpenAI model offering that can be used with the API.
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
Expand All @@ -11,12 +19,16 @@ pub struct Model {
pub created: u32,
/// The organization that owns the model.
pub owned_by: String,
/// Optional stats field provided when using Infinity Engine
pub stats: ModelStats,
/// Optional backend field provided when using Infinity Engine
pub backend: String,
}

#[derive(Debug, Deserialize, Clone, PartialEq, Serialize)]
pub struct ListModelResponse {
pub object: String,
pub data: Vec<Model>,
pub data: Model,
}

#[derive(Debug, Deserialize, Clone, PartialEq, Serialize)]
Expand Down

0 comments on commit e83bb55

Please sign in to comment.