diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/characters/create_character_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/characters/create_character_handler.rs index 7166d60b81..6471715302 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/characters/create_character_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/characters/create_character_handler.rs @@ -123,7 +123,7 @@ pub async fn create_character_handler( // --- Upload image to Kinovi CDN --- let seedance_image_url = upload_to_kinovi( - &server_state.seedance2pro.cookies, + &server_state.inference_providers.seedance2pro.cookies, image_cdn_url, ).await?; @@ -132,7 +132,7 @@ pub async fn create_character_handler( // --- Call Kinovi generate_character --- let session = Seedance2ProSession::from_cookies_string( - server_state.seedance2pro.cookies.clone() + server_state.inference_providers.seedance2pro.cookies.clone() ); let gen_result = generate_character(GenerateCharacterArgs { diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/characters/edit_character_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/characters/edit_character_handler.rs index 59c3c193e6..85195cfcb0 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/characters/edit_character_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/characters/edit_character_handler.rs @@ -101,7 +101,7 @@ pub async fn edit_character_handler( if has_name_change { if let Some(ref kinovi_id) = character.kinovi_character_id { let session = Seedance2ProSession::from_cookies_string( - server_state.seedance2pro.cookies.clone() + server_state.inference_providers.seedance2pro.cookies.clone() ); update_character(UpdateCharacterArgs { diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/angle/flux_2_lora_edit_image_angle_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/angle/flux_2_lora_edit_image_angle_handler.rs index c9b497eefc..708f0f4543 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/angle/flux_2_lora_edit_image_angle_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/angle/flux_2_lora_edit_image_angle_handler.rs @@ -94,7 +94,7 @@ pub async fn flux_2_lora_edit_image_angle_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -130,8 +130,8 @@ pub async fn flux_2_lora_edit_image_angle_handler( let args = EnqueueFlux2LoraEditImageAngleArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/angle/qwen_edit_2511_edit_image_angle_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/angle/qwen_edit_2511_edit_image_angle_handler.rs index 0045b8c7d8..5dce039124 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/angle/qwen_edit_2511_edit_image_angle_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/angle/qwen_edit_2511_edit_image_angle_handler.rs @@ -94,7 +94,7 @@ pub async fn qwen_edit_2511_edit_image_angle_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -131,8 +131,8 @@ pub async fn qwen_edit_2511_edit_image_angle_handler( let args = EnqueueQwenEdit2511EditImageAngleArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/bg_removal/remove_image_background_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/bg_removal/remove_image_background_handler.rs index a7500e941f..7622498ed1 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/bg_removal/remove_image_background_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/bg_removal/remove_image_background_handler.rs @@ -121,14 +121,14 @@ pub async fn remove_image_background_handler( server_state.server_environment, &bucket_path); - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let args = RemoveBackgroundRembgWebhookArgs { request: RemoveBackgroundRembgWebhookRequest { image_url: media_links.cdn_url.to_string(), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = remove_background_rembg_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/flux_pro_kontext_max_edit_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/flux_pro_kontext_max_edit_image_handler.rs index 6812e65174..42c599a6e2 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/flux_pro_kontext_max_edit_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/flux_pro_kontext_max_edit_image_handler.rs @@ -164,7 +164,7 @@ pub async fn flux_pro_kontext_max_edit_image_handler( // warn!("Temporary wallet deduction failed: {:?}", err); // Infallible for now. //} - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let num_images = match request.num_images { Some(FluxProKontextMaxEditImageNumImages::One) => FluxProKontextMaxNumImages::One, @@ -180,8 +180,8 @@ pub async fn flux_pro_kontext_max_edit_image_handler( image_url: image_url.to_string(), num_images, }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_flux_pro_kontext_max_edit_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/gemini_25_flash_edit_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/gemini_25_flash_edit_image_handler.rs index d123d65b69..9e26914078 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/gemini_25_flash_edit_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/gemini_25_flash_edit_image_handler.rs @@ -139,7 +139,7 @@ pub async fn gemini_25_flash_edit_image_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let mut num_images = match request.num_images { Some(Gemini25FlashEditImageNumImages::One) => Gemini25FlashEditNumImages::One, @@ -157,8 +157,8 @@ pub async fn gemini_25_flash_edit_image_handler( num_images, aspect_ratio: None, // TODO }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let apriori_job_token = InferenceJobToken::generate(); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/gpt_image_1_edit_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/gpt_image_1_edit_image_handler.rs index 41d1bb9d3e..98e64f6635 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/gpt_image_1_edit_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/gpt_image_1_edit_image_handler.rs @@ -141,7 +141,7 @@ pub async fn gpt_image_1_edit_image_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let image_size = match request.image_size { Some(GptImage1EditImageImageSize::Square) => GptEditImageSize::Square, @@ -168,7 +168,7 @@ pub async fn gpt_image_1_edit_image_handler( None => GptEditImageQuality::High, // Default to High }; - let openai_api_key = OpenAiApiKey::from_str(&server_state.openai.api_key); + let openai_api_key = OpenAiApiKey::from_str(&server_state.inference_providers.openai.api_key); let args = GptEditImageByokArgs { @@ -179,8 +179,8 @@ pub async fn gpt_image_1_edit_image_handler( image_size, quality, }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, openai_api_key: &openai_api_key, }; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/qwen_edit_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/qwen_edit_image_handler.rs index ee3a1dfc61..45a62f0730 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/qwen_edit_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/qwen_edit_image_handler.rs @@ -135,7 +135,7 @@ pub async fn qwen_edit_image_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -162,8 +162,8 @@ pub async fn qwen_edit_image_handler( negative_prompt: request.negative_prompt.clone(), acceleration: acceleration.map(|s| s.to_string()), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let cost = args.request.calculate_cost_in_cents(); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/seededit_3_edit_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/seededit_3_edit_image_handler.rs index cc12a465cf..d1f14b20c5 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/seededit_3_edit_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/edit/seededit_3_edit_image_handler.rs @@ -134,15 +134,15 @@ pub async fn seededit_3_edit_image_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let args = SeedEditV3EditArgs { request: SeedEditV3EditRequest { prompt: request.prompt.as_deref().unwrap_or("").to_string(), image_url: image_url.to_string(), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_seededit_v3_edit_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/inpaint/flux_dev_juggernaut_inpaint_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/inpaint/flux_dev_juggernaut_inpaint_handler.rs index 7b648228a7..defe3d3469 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/inpaint/flux_dev_juggernaut_inpaint_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/inpaint/flux_dev_juggernaut_inpaint_handler.rs @@ -160,7 +160,7 @@ pub async fn flux_dev_juggernaut_inpaint_image_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let num_images = match request.num_images { Some(FluxDevJuggernautInpaintImageNumImages::One) => FluxDevJuggernautInfillNumImages::One, @@ -177,8 +177,8 @@ pub async fn flux_dev_juggernaut_inpaint_image_handler( mask_url: mask_image_url, num_images, }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_flux_dev_juggernaut_infill_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/inpaint/flux_pro_1_inpaint_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/inpaint/flux_pro_1_inpaint_handler.rs index 10ee0877d8..71014a9749 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/inpaint/flux_pro_1_inpaint_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/inpaint/flux_pro_1_inpaint_handler.rs @@ -160,7 +160,7 @@ pub async fn flux_pro_1_inpaint_image_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let num_images = match request.num_images { Some(FluxPro1InpaintImageNumImages::One) => FluxPro1InfillNumImages::One, @@ -177,8 +177,8 @@ pub async fn flux_pro_1_inpaint_image_handler( mask_url: mask_image_url, num_images, }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_flux_pro_1_infill_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_5_lite_multi_function_image_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_5_lite_multi_function_image_gen_handler.rs index cd3b1b82be..11be14b145 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_5_lite_multi_function_image_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_5_lite_multi_function_image_gen_handler.rs @@ -98,7 +98,7 @@ pub async fn bytedance_seedream_5_lite_multi_function_image_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -141,8 +141,8 @@ pub async fn bytedance_seedream_5_lite_multi_function_image_gen_handler( let args = EnqueueBytedanceSeedreamV5LiteEditImageArgs { request: edit_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -205,8 +205,8 @@ pub async fn bytedance_seedream_5_lite_multi_function_image_gen_handler( let args = EnqueueBytedanceSeedreamV5LiteTextToImageArgs { request: t2i_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_bytedance_seedream_v5_lite_text_to_image_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_v4_multi_function_image_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_v4_multi_function_image_gen_handler.rs index 759d5c1487..c03383a34c 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_v4_multi_function_image_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_v4_multi_function_image_gen_handler.rs @@ -110,7 +110,7 @@ pub async fn bytedance_seedream_v4_multi_function_image_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -158,8 +158,8 @@ pub async fn bytedance_seedream_v4_multi_function_image_gen_handler( let args = EnqueueBytedanceSeedreamV4EditImageArgs { request: edit_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -227,8 +227,8 @@ pub async fn bytedance_seedream_v4_multi_function_image_gen_handler( let args = EnqueueBytedanceSeedreamV4TextToImageArgs { request: t2i_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_bytedance_seedream_v4_text_to_image_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_v4p5_multi_function_image_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_v4p5_multi_function_image_gen_handler.rs index 919b5c488c..c2ce51707e 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_v4p5_multi_function_image_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/bytedance_seedream_v4p5_multi_function_image_gen_handler.rs @@ -110,7 +110,7 @@ pub async fn bytedance_seedream_v4p5_multi_function_image_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -157,8 +157,8 @@ pub async fn bytedance_seedream_v4p5_multi_function_image_gen_handler( let args = EnqueueBytedanceSeedreamV4p5EditImageArgs { request: edit_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -225,8 +225,8 @@ pub async fn bytedance_seedream_v4p5_multi_function_image_gen_handler( let args = EnqueueBytedanceSeedreamV4p5TextToImageArgs { request: t2i_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_bytedance_seedream_v4p5_text_to_image_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/gpt_image_1p5_multi_function_image_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/gpt_image_1p5_multi_function_image_gen_handler.rs index 20e06149af..b68286d60f 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/gpt_image_1p5_multi_function_image_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/gpt_image_1p5_multi_function_image_gen_handler.rs @@ -144,7 +144,7 @@ pub async fn gpt_image_1p5_multi_function_image_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -206,8 +206,8 @@ pub async fn gpt_image_1p5_multi_function_image_gen_handler( let args = EnqueueGptImage1p5EditImageArgs { request: edit_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -272,8 +272,8 @@ pub async fn gpt_image_1p5_multi_function_image_gen_handler( let args = EnqueueGptImage1p5TextToImageArgs { request: t2i_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_2_multi_function_image_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_2_multi_function_image_gen_handler.rs index ee9ff30ae3..0748645db1 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_2_multi_function_image_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_2_multi_function_image_gen_handler.rs @@ -98,7 +98,7 @@ pub async fn nano_banana_2_multi_function_image_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -152,8 +152,8 @@ pub async fn nano_banana_2_multi_function_image_gen_handler( let args = EnqueueNanoBanana2EditImageArgs { request: edit_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -219,8 +219,8 @@ pub async fn nano_banana_2_multi_function_image_gen_handler( let args = EnqueueNanoBanana2TextToImageArgs { request: t2i_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_multi_function_image_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_multi_function_image_gen_handler.rs index c607705317..ccd44ed5fa 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_multi_function_image_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_multi_function_image_gen_handler.rs @@ -113,7 +113,7 @@ pub async fn nano_banana_multi_function_image_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -154,8 +154,8 @@ pub async fn nano_banana_multi_function_image_gen_handler( num_images, aspect_ratio: Some(aspect_ratio), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let cost = args.request.calculate_cost_in_cents(); @@ -213,8 +213,8 @@ pub async fn nano_banana_multi_function_image_gen_handler( let args = Gemini25FlashTextToImageArgs { request: t2i_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_pro_multi_function_image_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_pro_multi_function_image_gen_handler.rs index a7230e0bb6..b27aa756d7 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_pro_multi_function_image_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/multi_function/nano_banana_pro_multi_function_image_gen_handler.rs @@ -111,7 +111,7 @@ pub async fn nano_banana_pro_multi_function_image_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -160,8 +160,8 @@ pub async fn nano_banana_pro_multi_function_image_gen_handler( resolution: Some(resolution), aspect_ratio: Some(aspect_ratio), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let cost = args.request.calculate_cost_in_cents(); @@ -227,8 +227,8 @@ pub async fn nano_banana_pro_multi_function_image_gen_handler( let args = EnqueueNanoBananaProTextToImageArgs { request: t2i_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_1_dev_text_to_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_1_dev_text_to_image_handler.rs index 54f19cb1df..965226ad3b 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_1_dev_text_to_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_1_dev_text_to_image_handler.rs @@ -135,7 +135,7 @@ pub async fn generate_flux_1_dev_text_to_image_handler( const IS_MOD : bool = false; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let aspect_ratio = match request.aspect_ratio { Some(GenerateFlux1DevTextToImageAspectRatio::Square) => Flux1DevAspectRatio::Square, @@ -161,8 +161,8 @@ pub async fn generate_flux_1_dev_text_to_image_handler( aspect_ratio, num_images, }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_flux_1_dev_text_to_image_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_1_schnell_text_to_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_1_schnell_text_to_image_handler.rs index 880e556d42..0fc5371a7d 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_1_schnell_text_to_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_1_schnell_text_to_image_handler.rs @@ -115,7 +115,7 @@ pub async fn generate_flux_1_schnell_text_to_image_handler( const IS_MOD : bool = false; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let aspect_ratio = match request.aspect_ratio { Some(GenerateFlux1SchnellTextToImageAspectRatio::Square) => Flux1SchnellAspectRatio::Square, @@ -141,8 +141,8 @@ pub async fn generate_flux_1_schnell_text_to_image_handler( aspect_ratio, num_images, }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_flux_1_schnell_text_to_image_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_pro_11_text_to_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_pro_11_text_to_image_handler.rs index 818132defa..8fa742f181 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_pro_11_text_to_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_pro_11_text_to_image_handler.rs @@ -89,7 +89,7 @@ pub async fn generate_flux_pro_11_text_to_image_handler( const IS_MOD : bool = false; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -129,8 +129,8 @@ pub async fn generate_flux_pro_11_text_to_image_handler( let args = FluxPro11Args { request: flux_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_flux_pro_11_text_to_image_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_pro_11_ultra_text_to_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_pro_11_ultra_text_to_image_handler.rs index c8161487ca..58b1297e7f 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_pro_11_ultra_text_to_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_flux_pro_11_ultra_text_to_image_handler.rs @@ -89,7 +89,7 @@ pub async fn generate_flux_pro_11_ultra_text_to_image_handler( const IS_MOD : bool = false; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -133,8 +133,8 @@ pub async fn generate_flux_pro_11_ultra_text_to_image_handler( let args = FluxPro11UltraArgs { request: ultra_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_flux_pro_11_ultra_text_to_image_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_gpt_image_1_text_to_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_gpt_image_1_text_to_image_handler.rs index 9f0a4d3a47..974d54d62f 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_gpt_image_1_text_to_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/image/text/generate_gpt_image_1_text_to_image_handler.rs @@ -93,7 +93,7 @@ pub async fn generate_gpt_image_1_text_to_image_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let image_size = match request.image_size { Some(GenerateGptImage1TextToImageImageSize::Square) => GptTextToImageSize::Square, @@ -120,7 +120,7 @@ pub async fn generate_gpt_image_1_text_to_image_handler( None => GptTextToImageQuality::High, // Default to High }; - let openai_api_key = OpenAiApiKey::from_str(&server_state.openai.api_key); + let openai_api_key = OpenAiApiKey::from_str(&server_state.inference_providers.openai.api_key); let byok_request = GptTextToImageByokRequest { prompt: request.prompt.as_deref().unwrap_or("").to_string(), @@ -135,8 +135,8 @@ pub async fn generate_gpt_image_1_text_to_image_handler( let args = GptTextToImageByokArgs { request: byok_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, openai_api_key: &openai_api_key, }; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_0_image_to_3d_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_0_image_to_3d_handler.rs index 99673315b6..83700d57ba 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_0_image_to_3d_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_0_image_to_3d_handler.rs @@ -129,14 +129,14 @@ pub async fn generate_hunyuan_2_0_image_to_3d_handler( server_state.server_environment, &bucket_path); - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let args = Hunyuan3d2Args { request: Hunyuan3d2Request { image_url: media_links.cdn_url.to_string(), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_hunyuan_3d_2_image_to_3d_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_1_image_to_3d_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_1_image_to_3d_handler.rs index 8fac745821..bbe28df4f9 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_1_image_to_3d_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_1_image_to_3d_handler.rs @@ -128,14 +128,14 @@ pub async fn generate_hunyuan_2_1_image_to_3d_handler( server_state.server_environment, &bucket_path); - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let args = Hunyuan3d21Args { request: Hunyuan3d21Request { image_url: media_links.cdn_url.to_string(), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_hunyuan_3d_2_1_image_to_3d_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/multi_function/generate_hunyuan3d_v3_multi_function_object_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/multi_function/generate_hunyuan3d_v3_multi_function_object_handler.rs index e5bdf9deae..640ec962bc 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/multi_function/generate_hunyuan3d_v3_multi_function_object_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/multi_function/generate_hunyuan3d_v3_multi_function_object_handler.rs @@ -145,7 +145,7 @@ pub async fn generate_hunyuan3d_v3_multi_function_object_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); // Determine which mode we're in based on inputs let has_prompt = request @@ -185,8 +185,8 @@ pub async fn generate_hunyuan3d_v3_multi_function_object_handler( polygon_type, enable_pbr: Some(enable_pbr), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; enqueue_hunyuan3d_v3_text_to_3d_webhook(args) @@ -226,8 +226,8 @@ pub async fn generate_hunyuan3d_v3_multi_function_object_handler( polygon_type, enable_pbr: Some(enable_pbr), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; enqueue_hunyuan3d_v3_sketch_to_3d_webhook(args) @@ -269,8 +269,8 @@ pub async fn generate_hunyuan3d_v3_multi_function_object_handler( polygon_type, enable_pbr: Some(enable_pbr), }, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; enqueue_hunyuan3d_v3_image_to_3d_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/splat/generate_worldlabs_marble_0p1_mini_splat_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/splat/generate_worldlabs_marble_0p1_mini_splat_handler.rs index b559fae8a8..c6b2b9d103 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/splat/generate_worldlabs_marble_0p1_mini_splat_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/splat/generate_worldlabs_marble_0p1_mini_splat_handler.rs @@ -143,7 +143,7 @@ pub async fn generate_worldlabs_marble_0p1_mini_splat_handler( }; // Call World Labs API to start generation - let creds = WorldLabsApiCreds::new(server_state.worldlabs.api_key.clone()); + let creds = WorldLabsApiCreds::new(server_state.inference_providers.worldlabs.api_key.clone()); let generate_result = match generate_world(GenerateWorldArgs { creds: &creds, diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/splat/generate_worldlabs_marble_0p1_plus_splat_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/splat/generate_worldlabs_marble_0p1_plus_splat_handler.rs index 55064f40d5..270365ea94 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/splat/generate_worldlabs_marble_0p1_plus_splat_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/splat/generate_worldlabs_marble_0p1_plus_splat_handler.rs @@ -143,7 +143,7 @@ pub async fn generate_worldlabs_marble_0p1_plus_splat_handler( }; // Call World Labs API to start generation - let creds = WorldLabsApiCreds::new(server_state.worldlabs.api_key.clone()); + let creds = WorldLabsApiCreds::new(server_state.inference_providers.worldlabs.api_key.clone()); let generate_result = match generate_world(GenerateWorldArgs { creds: &creds, diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/edit/beeble_switchx_edit_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/edit/beeble_switchx_edit_video_gen_handler.rs index ceb50cb1cf..94f84a4e92 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/edit/beeble_switchx_edit_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/edit/beeble_switchx_edit_video_gen_handler.rs @@ -141,7 +141,7 @@ pub async fn beeble_switchx_edit_video_gen_handler( // ==================== DOWNLOAD & UPLOAD TO BEEBLE ==================== // - let beeble_api_key = &server_state.beeble.api_key; + let beeble_api_key = &server_state.inference_providers.beeble.api_key; // Download + upload source video info!("Downloading source video from CDN: {}", source_video_cdn_url); @@ -216,7 +216,7 @@ pub async fn beeble_switchx_edit_video_gen_handler( reference_image_uri: maybe_reference_beeble_uri, alpha_uri: None, max_resolution: Some(1080), - callback_url: Some(server_state.beeble.webhook_url.clone()), + callback_url: Some(server_state.inference_providers.beeble.webhook_url.clone()), idempotency_key: Some(request.uuid_idempotency_token.clone()), }, }).await.map_err(|err| { diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_1_6_pro_video_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_1_6_pro_video_handler.rs index e2a8d823fd..10d1d05412 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_1_6_pro_video_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_1_6_pro_video_handler.rs @@ -141,7 +141,7 @@ pub async fn generate_kling_1_6_pro_video_handler( })?), }; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -175,8 +175,8 @@ pub async fn generate_kling_1_6_pro_video_handler( let args = Kling1p6ProArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_2_1_master_video_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_2_1_master_video_handler.rs index 45a38f4a10..9a223b7581 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_2_1_master_video_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_2_1_master_video_handler.rs @@ -131,7 +131,7 @@ pub async fn generate_kling_2_1_master_video_handler( server_state.server_environment, &bucket_path); - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -164,8 +164,8 @@ pub async fn generate_kling_2_1_master_video_handler( let args = Kling2p1MasterArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_2_1_pro_video_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_2_1_pro_video_handler.rs index 14487e1a45..23ee63b22f 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_2_1_pro_video_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_kling_2_1_pro_video_handler.rs @@ -146,7 +146,7 @@ pub async fn generate_kling_2_1_pro_video_handler( })?), }; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -180,8 +180,8 @@ pub async fn generate_kling_2_1_pro_video_handler( let args = Kling2p1ProArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_seedance_1_0_lite_image_to_video_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_seedance_1_0_lite_image_to_video_handler.rs index db4d70174b..dc703ed252 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_seedance_1_0_lite_image_to_video_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_seedance_1_0_lite_image_to_video_handler.rs @@ -146,7 +146,7 @@ pub async fn generate_seedance_1_0_lite_image_to_video_handler( })?), }; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -203,8 +203,8 @@ pub async fn generate_seedance_1_0_lite_image_to_video_handler( let args = Seedance1LiteArgs { request: i2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_seedance_1_lite_image_to_video_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_seedance_1_0_pro_image_to_video_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_seedance_1_0_pro_image_to_video_handler.rs index 06ca9a101f..d3ee9d883c 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_seedance_1_0_pro_image_to_video_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_seedance_1_0_pro_image_to_video_handler.rs @@ -125,7 +125,7 @@ pub async fn generate_seedance_1_0_pro_image_to_video_handler( CommonWebError::NotFound })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -177,8 +177,8 @@ pub async fn generate_seedance_1_0_pro_image_to_video_handler( let args = Seedance1ProArgs { request: i2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; let fal_result = enqueue_seedance_1_pro_image_to_video_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_2_image_to_video_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_2_image_to_video_handler.rs index 92ff2356c9..b05dcec08b 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_2_image_to_video_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_2_image_to_video_handler.rs @@ -138,7 +138,7 @@ pub async fn generate_veo_2_image_to_video_handler( server_state.server_environment, &bucket_path); - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -169,8 +169,8 @@ pub async fn generate_veo_2_image_to_video_handler( let args = Veo2Args { request: veo2_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_3_fast_image_to_video_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_3_fast_image_to_video_handler.rs index 3490950859..b587720856 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_3_fast_image_to_video_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_3_fast_image_to_video_handler.rs @@ -130,7 +130,7 @@ pub async fn generate_veo_3_fast_image_to_video_handler( server_state.server_environment, &bucket_path); - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -173,8 +173,8 @@ pub async fn generate_veo_3_fast_image_to_video_handler( let args = Veo3FastArgs { request: veo3_fast_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_3_image_to_video_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_3_image_to_video_handler.rs index 7465638d32..9fd1adceb9 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_3_image_to_video_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/image/generate_veo_3_image_to_video_handler.rs @@ -133,7 +133,7 @@ pub async fn generate_veo_3_image_to_video_handler( server_state.server_environment, &bucket_path); - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -177,8 +177,8 @@ pub async fn generate_veo_3_image_to_video_handler( let args = Veo3Args { request: veo3_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_2p5_turbo_pro_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_2p5_turbo_pro_multi_function_video_gen_handler.rs index c654ec1c0d..a4b046e1ea 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_2p5_turbo_pro_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_2p5_turbo_pro_multi_function_video_gen_handler.rs @@ -146,7 +146,7 @@ pub async fn kling_2p5_turbo_pro_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -176,8 +176,8 @@ pub async fn kling_2p5_turbo_pro_multi_function_video_gen_handler( let args = EnqueueKlingV2p5TurboProImageToVideoArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -225,8 +225,8 @@ pub async fn kling_2p5_turbo_pro_multi_function_video_gen_handler( let args = EnqueueKlingV2p5TurboProTextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_2p6_pro_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_2p6_pro_multi_function_video_gen_handler.rs index fc6c5e2e62..9f4038cccf 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_2p6_pro_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_2p6_pro_multi_function_video_gen_handler.rs @@ -144,7 +144,7 @@ pub async fn kling_2p6_pro_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -173,8 +173,8 @@ pub async fn kling_2p6_pro_multi_function_video_gen_handler( let args = EnqueueKlingV2p6ProImageToVideoArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -222,8 +222,8 @@ pub async fn kling_2p6_pro_multi_function_video_gen_handler( let args = EnqueueKlingV2p6ProTextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet..."); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_3p0_pro_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_3p0_pro_multi_function_video_gen_handler.rs index 7382c60e58..42a985f916 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_3p0_pro_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_3p0_pro_multi_function_video_gen_handler.rs @@ -143,7 +143,7 @@ pub async fn kling_3p0_pro_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -175,8 +175,8 @@ pub async fn kling_3p0_pro_multi_function_video_gen_handler( let args = EnqueueKling3p0ProImageToVideoArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -216,8 +216,8 @@ pub async fn kling_3p0_pro_multi_function_video_gen_handler( let args = EnqueueKling3p0ProTextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet..."); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_3p0_standard_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_3p0_standard_multi_function_video_gen_handler.rs index 2747eaee17..4e82753890 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_3p0_standard_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/kling_3p0_standard_multi_function_video_gen_handler.rs @@ -143,7 +143,7 @@ pub async fn kling_3p0_standard_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -175,8 +175,8 @@ pub async fn kling_3p0_standard_multi_function_video_gen_handler( let args = EnqueueKling3p0StandardImageToVideoArgs { request: fal_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -216,8 +216,8 @@ pub async fn kling_3p0_standard_multi_function_video_gen_handler( let args = EnqueueKling3p0StandardTextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet..."); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/seedance_1p5_pro_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/seedance_1p5_pro_multi_function_video_gen_handler.rs index c8eed1d9e3..7657eb9a40 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/seedance_1p5_pro_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/seedance_1p5_pro_multi_function_video_gen_handler.rs @@ -131,7 +131,7 @@ pub async fn seedance_1p5_pro_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -172,8 +172,8 @@ pub async fn seedance_1p5_pro_multi_function_video_gen_handler( let args = EnqueueSeedance1p5ProImageToVideoArgs { request: i2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_seedance_1p5_pro_image_to_video_webhook(args) @@ -203,8 +203,8 @@ pub async fn seedance_1p5_pro_multi_function_video_gen_handler( let args = EnqueueSeedance1p5ProTextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/seedance_2p0_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/seedance_2p0_multi_function_video_gen_handler.rs index a4ee1f1587..684fbf7ea0 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/seedance_2p0_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/seedance_2p0_multi_function_video_gen_handler.rs @@ -192,7 +192,7 @@ pub async fn seedance_2p0_multi_function_video_gen_handler( info!("User {:?} is seedance-whitelisted, trying whitelist session first", user_token); let whitelist_session = Seedance2ProSession::from_cookies_string( - server_state.seedance2pro.cookies_byteplus.clone() + server_state.inference_providers.seedance2pro.cookies_byteplus.clone() ); let result = upload_and_generate( @@ -215,7 +215,7 @@ pub async fn seedance_2p0_multi_function_video_gen_handler( warn!("Whitelist session failed for user {:?}: {:?}, falling back to regular session", user_token, err); let regular_session = Seedance2ProSession::from_cookies_string( - server_state.seedance2pro.cookies.clone() + server_state.inference_providers.seedance2pro.cookies.clone() ); let result = upload_and_generate( @@ -253,7 +253,7 @@ pub async fn seedance_2p0_multi_function_video_gen_handler( info!("User {:?} using regular seedance session", user_token); let regular_session = Seedance2ProSession::from_cookies_string( - server_state.seedance2pro.cookies.clone() + server_state.inference_providers.seedance2pro.cookies.clone() ); let result = upload_and_generate( diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/sora_2_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/sora_2_multi_function_video_gen_handler.rs index 8e89fc83df..932feac4f6 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/sora_2_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/sora_2_multi_function_video_gen_handler.rs @@ -144,7 +144,7 @@ pub async fn sora_2_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -196,8 +196,8 @@ pub async fn sora_2_multi_function_video_gen_handler( let args = EnqueueSora2ImageToVideoArgs { request: i2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_sora_2_image_to_video_webhook(args) @@ -251,8 +251,8 @@ pub async fn sora_2_multi_function_video_gen_handler( let args = EnqueueSora2TextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_sora_2_text_to_video_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/sora_2_pro_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/sora_2_pro_multi_function_video_gen_handler.rs index 51c1160861..b4ec18a07f 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/sora_2_pro_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/sora_2_pro_multi_function_video_gen_handler.rs @@ -144,7 +144,7 @@ pub async fn sora_2_pro_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -197,8 +197,8 @@ pub async fn sora_2_pro_multi_function_video_gen_handler( let args = EnqueueSora2ProImageToVideoArgs { request: i2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_sora_2_pro_image_to_video_webhook(args) @@ -253,8 +253,8 @@ pub async fn sora_2_pro_multi_function_video_gen_handler( let args = EnqueueSora2ProTextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_sora_2_pro_text_to_video_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/veo_3p1_fast_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/veo_3p1_fast_multi_function_video_gen_handler.rs index f12887b23f..c3938c4c61 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/veo_3p1_fast_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/veo_3p1_fast_multi_function_video_gen_handler.rs @@ -143,7 +143,7 @@ pub async fn veo_3p1_fast_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -192,8 +192,8 @@ pub async fn veo_3p1_fast_multi_function_video_gen_handler( let args = EnqueueVeo3p1FastFirstLastFrameImageToVideoArgs { request: flf_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -249,8 +249,8 @@ pub async fn veo_3p1_fast_multi_function_video_gen_handler( let args = EnqueueVeo3p1FastImageToVideoArgs { request: i2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -319,8 +319,8 @@ pub async fn veo_3p1_fast_multi_function_video_gen_handler( let args = EnqueueVeo3p1FastTextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_veo_3p1_fast_text_to_video_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/veo_3p1_multi_function_video_gen_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/veo_3p1_multi_function_video_gen_handler.rs index 0d8b83171f..da57faef1a 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/veo_3p1_multi_function_video_gen_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/video/multi_function/veo_3p1_multi_function_video_gen_handler.rs @@ -143,7 +143,7 @@ pub async fn veo_3p1_multi_function_video_gen_handler( CommonWebError::BadInputWithSimpleMessage("repeated idempotency token".to_string()) })?; - info!("Fal webhook URL: {}", server_state.fal.webhook_url); + info!("Fal webhook URL: {}", server_state.inference_providers.fal.webhook_url); let apriori_job_token = InferenceJobToken::generate(); @@ -192,8 +192,8 @@ pub async fn veo_3p1_multi_function_video_gen_handler( let args = EnqueueVeo3p1FirstLastFrameImageToVideoArgs { request: flf_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -249,8 +249,8 @@ pub async fn veo_3p1_multi_function_video_gen_handler( let args = EnqueueVeo3p1ImageToVideoArgs { request: i2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; info!("Charging wallet: {}", cost); @@ -319,8 +319,8 @@ pub async fn veo_3p1_multi_function_video_gen_handler( let args = EnqueueVeo3p1TextToVideoArgs { request: t2v_request, - webhook_url: &server_state.fal.webhook_url, - api_key: &server_state.fal.api_key, + webhook_url: &server_state.inference_providers.fal.webhook_url, + api_key: &server_state.inference_providers.fal.api_key, }; fal_result = enqueue_veo_3p1_text_to_video_webhook(args) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/omni_gen/generate/image/pipeline_v2/run_pipeline_v2.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/omni_gen/generate/image/pipeline_v2/run_pipeline_v2.rs index 4387d4de53..acb1b7c079 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/omni_gen/generate/image/pipeline_v2/run_pipeline_v2.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/omni_gen/generate/image/pipeline_v2/run_pipeline_v2.rs @@ -156,8 +156,8 @@ fn build_router_client( match provider { RouterProvider::Fal => { let fal_client = RouterFalClient::new_with_webhook( - server_state.fal.api_key.clone(), - server_state.fal.webhook_url.clone(), + server_state.inference_providers.fal.api_key.clone(), + server_state.inference_providers.fal.webhook_url.clone(), ); Ok(RouterClient::Fal(fal_client)) }, diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/omni_gen/generate/video/helpers/build_router_client.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/omni_gen/generate/video/helpers/build_router_client.rs index 0a9e847a4b..444b1a3bf8 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/omni_gen/generate/video/helpers/build_router_client.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/omni_gen/generate/video/helpers/build_router_client.rs @@ -22,19 +22,19 @@ pub fn build_router_client( } RouterProvider::Fal => { let fal_client = RouterFalClient::new_with_webhook( - server_state.fal.api_key.clone(), - server_state.fal.webhook_url.clone(), + server_state.inference_providers.fal.api_key.clone(), + server_state.inference_providers.fal.webhook_url.clone(), ); Ok(RouterClient::Fal(fal_client)) } RouterProvider::GmiCloud => { Ok(RouterClient::GmiCloud(RouterGmiCloudClient::new( - server_state.gmicloud.api_key.clone(), + server_state.inference_providers.gmicloud.api_key.clone(), ))) } RouterProvider::GrokApi => { Ok(RouterClient::GrokApi(RouterGrokApiClient::new( - server_state.grok_api.api_key.clone(), + server_state.inference_providers.grok_api.api_key.clone(), ))) } other => { @@ -49,12 +49,12 @@ fn kinovi_provider(server_state: &ServerState, use_alternate_kinovi: bool) -> Re let session = if use_alternate_kinovi { // Alternate Kinovi Seedance2ProSession::from_cookies_string( - server_state.seedance2pro.cookies_byteplus.clone() + server_state.inference_providers.seedance2pro.cookies_byteplus.clone() ) } else { // Standard Kinovi Seedance2ProSession::from_cookies_string( - server_state.seedance2pro.cookies.clone() + server_state.inference_providers.seedance2pro.cookies.clone() ) }; diff --git a/crates/service/web/storyteller_web/src/startup/build_dependencies.rs b/crates/service/web/storyteller_web/src/startup/build_dependencies.rs index d0f663e461..a2ed3b4a4a 100644 --- a/crates/service/web/storyteller_web/src/startup/build_dependencies.rs +++ b/crates/service/web/storyteller_web/src/startup/build_dependencies.rs @@ -9,7 +9,6 @@ use cloud_storage::bucket_client::BucketClient; use elasticsearch::http::transport::Transport; use elasticsearch::Elasticsearch; use errors::AnyhowResult; -use fal_client::creds::fal_api_key::FalApiKey; use log::info; use memory_caching::arc_ttl_sieve::ArcTtlSieve; use memory_caching::single_item_ttl_cache::SingleItemTtlCache; @@ -34,15 +33,16 @@ use crate::startup::setup_bans::{ load_cidr_bans, load_ip_address_troll_bans, load_static_container_ip_bans, load_troll_user_token_bans, }; +use crate::startup::setup_inference_providers::setup_inference_providers; use crate::startup::setup_static_feature_flags::setup_static_feature_flags; use crate::startup::setup_stripe_artcraft::setup_stripe_artcraft; use crate::startup::setup_stripe_fakeyou::setup_stripe_fakeyou; use crate::state::certs::google_sign_in_cert::GoogleSignInCert; use crate::state::memory_cache::model_token_to_info_cache::ModelTokenToInfoCache; use crate::state::server_state::{ - BeebleData, DurableInMemoryCaches, EnvConfig, EphemeralInMemoryCaches, FalData, - GmiCloudData, GrokApiData, InMemoryCaches, OpenAiData, ResendData, Seedance2ProData, ServerInfo, - ServerState, TrollBans, WorldLabsData, + DurableInMemoryCaches, EnvConfig, EphemeralInMemoryCaches, + InMemoryCaches, ResendData, ServerInfo, + ServerState, TrollBans, }; use crate::threads::db_health_checker_thread::db_health_check_status::HealthCheckStatus; use crate::util::encrypted_sort_id::SortKeyCrypto; @@ -197,14 +197,9 @@ pub async fn setup_dependencies(server_hostname: &str) -> AnyhowResult AnyhowResult AnyhowResult { + Ok(InferenceProviders { + fal: FalData { + api_key: FalApiKey::new(easyenv::get_env_string_required("FAL_API_KEY")?), + webhook_url: easyenv::get_env_string_required("FAL_WEBHOOK_URL")?, + }, + gmicloud: GmiCloudData { + api_key: gmicloud_client::creds::gmicloud_api_key::GmiCloudApiKey::new( + easyenv::get_env_string_required("GMICLOUD_API_KEY")?, + ), + }, + grok_api: GrokApiData { + api_key: grok_api_client::creds::grok_api_key::GrokApiKey::new( + easyenv::get_env_string_required("GROK_API_KEY")?, + ), + }, + beeble: BeebleData { + api_key: BeebleApiKey::new(easyenv::get_env_string_required("BEEBLE_API_KEY")?), + webhook_url: easyenv::get_env_string_required("BEEBLE_WEBHOOK_URL")?, + }, + seedance2pro: Seedance2ProData { + cookies: easyenv::get_env_string_required("SEEDANCE2PRO_COOKIES")?, + cookies_byteplus: easyenv::get_env_string_required("SEEDANCE2PRO_WHITELIST_COOKIES")?, + }, + openai: OpenAiData { + api_key: easyenv::get_env_string_required("OPENAI_API_KEY")?, + }, + worldlabs: WorldLabsData { + api_key: easyenv::get_env_string_required("WORLDLABS_API_KEY")?, + }, + }) +} diff --git a/crates/service/web/storyteller_web/src/state/server_state.rs b/crates/service/web/storyteller_web/src/state/server_state.rs index 32e1b5006f..78e60bdce0 100644 --- a/crates/service/web/storyteller_web/src/state/server_state.rs +++ b/crates/service/web/storyteller_web/src/state/server_state.rs @@ -9,6 +9,7 @@ use crate::http_server::endpoints::voice_conversion::list_voice_conversion_model use crate::http_server::session::session_checker::SessionChecker; use crate::http_server::web_utils::redis_rate_limiter::RedisRateLimiter; use crate::http_server::web_utils::scoped_temp_dir_creator::ScopedTempDirCreator; +use crate::startup::setup_inference_providers::InferenceProviders; use crate::state::certs::google_sign_in_cert::GoogleSignInCert; use crate::state::flags::paging_flags::PagingFlags; use crate::state::memory_cache::model_token_to_info_cache::ModelTokenToInfoCache; @@ -25,8 +26,6 @@ use billing_component::stripe::stripe_config::StripeConfig; use chrono::{DateTime, Utc}; use cloud_storage::bucket_client::BucketClient; use elasticsearch::Elasticsearch; -use beeble_client::creds::beeble_api_key::BeebleApiKey; -use fal_client::creds::fal_api_key::FalApiKey; use memory_caching::arc_ttl_sieve::ArcTtlSieve; use memory_caching::single_item_ttl_cache::SingleItemTtlCache; use mysql_queries::mediators::badge_granter::BadgeGranter; @@ -89,22 +88,10 @@ pub struct ServerState { pub public_bucket_client: BucketClient, pub auto_gc_bucket_client: BucketClient, - pub fal: FalData, + pub inference_providers: InferenceProviders, - pub gmicloud: GmiCloudData, - - pub grok_api: GrokApiData, - - pub beeble: BeebleData, - - pub seedance2pro: Seedance2ProData, - - pub openai: OpenAiData, - pub resend: ResendData, - pub worldlabs: WorldLabsData, - pub pager: Pager, /// Where to store audio uploads for w2l @@ -313,56 +300,8 @@ pub struct TrollBans { pub ip_addresses: IpBanList, } -/// Fal integration -#[derive(Clone)] -pub struct FalData { - pub api_key: FalApiKey, - pub webhook_url: String, -} - -/// GmiCloud integration -#[derive(Clone)] -pub struct GmiCloudData { - pub api_key: gmicloud_client::creds::gmicloud_api_key::GmiCloudApiKey, -} - -/// Grok (xAI) API integration -#[derive(Clone)] -pub struct GrokApiData { - pub api_key: grok_api_client::creds::grok_api_key::GrokApiKey, -} - -/// Beeble SwitchX integration -#[derive(Clone)] -pub struct BeebleData { - pub api_key: BeebleApiKey, - pub webhook_url: String, -} - -/// Seedance 2 Pro integration -#[derive(Clone)] -pub struct Seedance2ProData { - /// Cookie string for seedance2-pro.com - pub cookies: String, - - /// Cookie string for seedance2-pro.com (Whitelisted account) - pub cookies_byteplus: String, -} - -/// OpenAI integration -#[derive(Clone)] -pub struct OpenAiData { - pub api_key: String, -} - /// Resend integration #[derive(Clone)] pub struct ResendData { pub api_key: String, } - -/// World Labs integration -#[derive(Clone)] -pub struct WorldLabsData { - pub api_key: String, -}