mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
get provider
This commit is contained in:
1 parent
a1c026212c
commit
4f79fb4601
3 files changed
+26
-1
No files matched your search
+8
-1
@@ -1,4 +1,4 @@
|
||||
use crate::client::router_client::RouterClient;
|
||||
use crate::api::provider::Provider;
|
||||
use crate::errors::artcraft_router_error::ArtcraftRouterError;
|
||||
use crate::generate::generate_video::video_generation_cost_estimate::VideoGenerationCostEstimate;
|
||||
use crate::generate::generate_video_v2::providers::kinovi::seedance_2p0::cost::KinoviSeedance2p0CostState;
|
||||
@@ -19,6 +19,13 @@ pub enum VideoGenerationDraftRequest {
|
||||
|
||||
impl VideoGenerationDraftRequest {
|
||||
|
||||
pub fn get_provider(&self) -> Provider {
|
||||
match self {
|
||||
Self::KinoviSeedance2p0(_) => Provider::Seedance2Pro,
|
||||
Self::KinoviSeedance2p0Fast(_) => Provider::Seedance2Pro,
|
||||
}
|
||||
}
|
||||
|
||||
/// Return a cost estimate to fulfill the request.
|
||||
pub fn estimate_cost(&self) -> Result<VideoGenerationCostEstimate, ArtcraftRouterError> {
|
||||
match self {
|
||||
|
||||
+8
@@ -1,3 +1,4 @@
|
||||
use crate::api::provider::Provider;
|
||||
use crate::errors::artcraft_router_error::ArtcraftRouterError;
|
||||
use crate::generate::generate_video::video_generation_cost_estimate::VideoGenerationCostEstimate;
|
||||
use crate::generate::generate_video_v2::video_generation_draft::VideoGenerationDraftRequest;
|
||||
@@ -10,6 +11,13 @@ pub enum VideoGenerationDraftOrRequest {
|
||||
|
||||
impl VideoGenerationDraftOrRequest {
|
||||
|
||||
pub fn get_provider(&self) -> Provider {
|
||||
match self {
|
||||
Self::Draft(draft) => draft.get_provider(),
|
||||
Self::Request(request) => request.get_provider(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn estimate_cost(&self) -> Result<VideoGenerationCostEstimate, ArtcraftRouterError> {
|
||||
match self {
|
||||
VideoGenerationDraftOrRequest::Draft(draft) => draft.estimate_cost(),
|
||||
|
||||
+10
@@ -1,3 +1,4 @@
|
||||
use crate::api::provider::Provider;
|
||||
use crate::client::router_client::RouterClient;
|
||||
use crate::errors::artcraft_router_error::ArtcraftRouterError;
|
||||
use crate::generate::generate_video::generate_video_response::GenerateVideoResponse;
|
||||
@@ -21,6 +22,15 @@ pub enum VideoGenerationRequest {
|
||||
|
||||
impl VideoGenerationRequest {
|
||||
|
||||
pub fn get_provider(&self) -> Provider {
|
||||
match self {
|
||||
Self::ArtcraftSeedance2p0(_) => Provider::Artcraft,
|
||||
Self::ArtcraftSeedance2p0Fast(_) => Provider::Artcraft,
|
||||
Self::KinoviSeedance2p0(_) => Provider::Seedance2Pro,
|
||||
Self::KinoviSeedance2p0Fast(_) => Provider::Seedance2Pro,
|
||||
}
|
||||
}
|
||||
|
||||
/// Return a cost estimate to fulfill the request.
|
||||
pub fn estimate_cost(&self) -> Result<VideoGenerationCostEstimate, ArtcraftRouterError> {
|
||||
match self {
|
||||
|
||||
Reference in new issue
Block a user