use serde::{Deserialize, Serialize};
pub const PATH: &str = "/models";
#[derive(Debug, Deserialize, Serialize)]
pub struct Request {
#[serde(skip_serializing_if = "Option::is_none")]
pub capability: Option<String>,
}
impl Request {
pub fn new(capability: Option<String>) -> Request {
Self { capability }
}
}
#[derive(Debug, Default, Deserialize, Serialize)]
#[serde(default)]
pub struct ModelCapabilities {
pub chat_completion: bool,
pub chat_with_image: bool,
pub completion: bool,
pub embedding: bool,
pub embedding_with_image: bool,
pub tokenize: bool,
}
#[derive(Debug, Default, Deserialize, Serialize)]
#[serde(default)]
pub struct ModelData {
pub id: String,
pub object: String,
pub created: String,
pub owned_by: String,
pub description: String,
pub max_context_length: i64,
pub prompt_format: String,
pub capabilities: ModelCapabilities,
}
#[derive(Debug, Default, Deserialize, Serialize)]
#[serde(default)]
pub struct Response {
pub object: String,
pub data: Vec<ModelData>,
}