From 97bd706973c35d0dd077d5054a43173ffe00501a Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 2 Jul 2025 13:58:25 -0400 Subject: [PATCH] wip debugging --- .../enqueue_gpt_image_1_edit_image_webhook.rs | 2 +- crates/vendor/fal-rs/src/request.rs | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/crates/api_clients/fal_client/src/requests/webhook/image/enqueue_gpt_image_1_edit_image_webhook.rs b/crates/api_clients/fal_client/src/requests/webhook/image/enqueue_gpt_image_1_edit_image_webhook.rs index a383a0b8b2..00ceadce75 100644 --- a/crates/api_clients/fal_client/src/requests/webhook/image/enqueue_gpt_image_1_edit_image_webhook.rs +++ b/crates/api_clients/fal_client/src/requests/webhook/image/enqueue_gpt_image_1_edit_image_webhook.rs @@ -76,7 +76,7 @@ pub async fn enqueue_gpt_image_1_edit_image_webhook( image_size: image_size.to_string(), num_images, quality: quality.to_string(), - openai_api_key: "".to_string(), + openai_api_key: args.open_ai_api_key.0.to_string(), }; let result = gpt_edit_image(request) diff --git a/crates/vendor/fal-rs/src/request.rs b/crates/vendor/fal-rs/src/request.rs index 107f313fb7..dee4a025a9 100644 --- a/crates/vendor/fal-rs/src/request.rs +++ b/crates/vendor/fal-rs/src/request.rs @@ -137,22 +137,40 @@ impl FalRequest .api_key .expect("No fal API key provided, and FAL_API_KEY environment variable is not set"); + println!("Getting URL..."); + let url_encoded = url.into_url()?; //let url_encoded = utf8_percent_encode(url_encoded.as_str(), NON_ALPHANUMERIC).to_string(); let request_url = format!("https://queue.fal.run/{}?fal_webhook={}", self.endpoint, url_encoded); info!("Sending request to FAL queue webhook: {}", request_url); + println!("Sending request to FAL queue webhook: {}", request_url); - let response = self + let builder = self .client - .post(request_url) + .post(request_url); + + println!("Builder 1"); + println!("key is {}", &key); + + let builder = builder .json(&self.params) .header("Authorization", format!("Key {}", &key)) - .header("Content-Type", "application/json") - .send() + .header("Content-Type", "application/json"); + + println!("Builder 2"); + + let response = builder + .send(); + + println!("Builder sent"); + + let response = response .await?; + println!("Response status: {:?}", response.status()); + if response.status() != 200 { let error = response.text().await?; return Err(error.into());