This commit is contained in:
Brandon Thomas committed 2026-03-28 12:10:19 -04:00
1 parent 5bfb99d178
commit b2c8d1c5f6
6 files changed
+27 -20

No files matched your search

@@ -31,18 +31,19 @@ impl Default for OmniGenImageModelsProvider {
/// Response body for the image models endpoint.
/// TBD — fields will be added later.
#[derive(Serialize, ToSchema)]
#[derive(Serialize, ToSchema, Clone)]
pub struct OmniGenImageModelsResponse {
pub success: bool,
pub providers: Vec<OmniGenImageProviderModels>,
}
#[derive(Serialize, ToSchema)]
#[derive(Serialize, ToSchema, Clone)]
pub struct OmniGenImageProviderModels {
pub provider: GenerationProvider,
pub models: Vec<OmniGenImageModelDetails>,
}
#[derive(Serialize, ToSchema)]
#[derive(Serialize, ToSchema, Clone)]
pub struct OmniGenImageModelDetails {
pub model: CommonImageModel,
@@ -31,19 +31,19 @@ impl Default for OmniGenVideoModelsProvider {
/// Response body for the video models endpoint.
/// TBD — fields will be added later.
#[derive(Serialize, ToSchema)]
#[derive(Serialize, ToSchema, Clone)]
pub struct OmniGenVideoModelsResponse {
pub success: bool,
pub providers: OmniGenVideoProviderModels,
pub providers: Vec<OmniGenVideoProviderModels>,
}
#[derive(Serialize, ToSchema)]
#[derive(Serialize, ToSchema, Clone)]
pub struct OmniGenVideoProviderModels {
pub provider: GenerationProvider,
pub models: Vec<OmniGenVideoModelDetails>,
}
#[derive(Serialize, ToSchema)]
#[derive(Serialize, ToSchema, Clone)]
pub struct OmniGenVideoModelDetails {
pub model: CommonVideoModel,
@@ -1,11 +1,11 @@
use artcraft_api_defs::omni_gen::models::omni_gen_image_models::{OmniGenImageModelDetails, OmniGenImageProviderModels};
use enums::common::generation::common_aspect_ratio::CommonAspectRatio;
use enums::common::generation::common_image_model::CommonImageModel;
use enums::common::generation::common_resolution::CommonResolution;
use enums::common::generation_provider::GenerationProvider;
use once_cell::sync::Lazy;
use enums::common::generation::common_resolution::CommonResolution;
pub const IMAGE_MODELS: Lazy<Vec<OmniGenImageProviderModels>> = Lazy::new(|| {
pub const OMNI_GEN_IMAGE_MODELS: Lazy<Vec<OmniGenImageProviderModels>> = Lazy::new(|| {
let mut models = Vec::new();
models.push(OmniGenImageProviderModels {
@@ -5,7 +5,7 @@ use enums::common::generation::common_video_model::CommonVideoModel;
use enums::common::generation_provider::GenerationProvider;
use once_cell::sync::Lazy;
pub const VIDEO_MODELS: Lazy<Vec<OmniGenVideoProviderModels>> = Lazy::new(|| {
pub const OMNI_GEN_VIDEO_MODELS: Lazy<Vec<OmniGenVideoProviderModels>> = Lazy::new(|| {
let mut models = Vec::new();
models.push(OmniGenVideoProviderModels {
@@ -1,16 +1,15 @@
use std::sync::Arc;
use crate::configs::omni_gen::image_models::OMNI_GEN_IMAGE_MODELS;
use crate::http_server::common_responses::common_web_error::CommonWebError;
use crate::state::server_state::ServerState;
use actix_web::web::{Json, Query};
use actix_web::{web, HttpRequest};
use artcraft_api_defs::omni_gen::models::omni_gen_image_models::{
OmniGenImageModelsQuery,
OmniGenImageModelsResponse,
};
use crate::http_server::common_responses::common_web_error::CommonWebError;
use crate::state::server_state::ServerState;
/// List available image models.
#[utoipa::path(
get,
@@ -27,5 +26,9 @@ pub async fn omni_gen_image_models_handler(
_query: Query<OmniGenImageModelsQuery>,
_server_state: web::Data<Arc<ServerState>>,
) -> Result<Json<OmniGenImageModelsResponse>, CommonWebError> {
todo!()
let providers = (*OMNI_GEN_IMAGE_MODELS).clone();
Ok(Json(OmniGenImageModelsResponse {
success: true,
providers,
}))
}
@@ -1,16 +1,15 @@
use std::sync::Arc;
use crate::configs::omni_gen::video_models::OMNI_GEN_VIDEO_MODELS;
use crate::http_server::common_responses::common_web_error::CommonWebError;
use crate::state::server_state::ServerState;
use actix_web::web::{Json, Query};
use actix_web::{web, HttpRequest};
use artcraft_api_defs::omni_gen::models::omni_gen_video_models::{
OmniGenVideoModelsQuery,
OmniGenVideoModelsResponse,
};
use crate::http_server::common_responses::common_web_error::CommonWebError;
use crate::state::server_state::ServerState;
/// List available video models.
#[utoipa::path(
get,
@@ -27,5 +26,9 @@ pub async fn omni_gen_video_models_handler(
_query: Query<OmniGenVideoModelsQuery>,
_server_state: web::Data<Arc<ServerState>>,
) -> Result<Json<OmniGenVideoModelsResponse>, CommonWebError> {
todo!()
let providers = (*OMNI_GEN_VIDEO_MODELS).clone();
Ok(Json(OmniGenVideoModelsResponse {
success: true,
providers,
}))
}