diff --git a/libs/client-api/src/http_ai.rs b/libs/client-api/src/http_ai.rs index 74da345b..73f913c5 100644 --- a/libs/client-api/src/http_ai.rs +++ b/libs/client-api/src/http_ai.rs @@ -6,6 +6,7 @@ use shared_entity::dto::ai_dto::{ SummarizeRowResponse, TranslateRowParams, TranslateRowResponse, }; use shared_entity::response::{AppResponse, AppResponseError}; +use std::time::Duration; use tracing::instrument; impl Client { @@ -46,6 +47,7 @@ impl Client { .http_client_with_auth(Method::POST, &url) .await? .json(¶ms) + .timeout(Duration::from_secs(30)) .send() .await?; @@ -66,6 +68,7 @@ impl Client { .http_client_with_auth(Method::POST, &url) .await? .json(¶ms) + .timeout(Duration::from_secs(30)) .send() .await?; log_request_id(&resp); diff --git a/libs/client-api/src/http_chat.rs b/libs/client-api/src/http_chat.rs index 8afdfefe..c0a7d713 100644 --- a/libs/client-api/src/http_chat.rs +++ b/libs/client-api/src/http_chat.rs @@ -15,6 +15,7 @@ use shared_entity::dto::ai_dto::{ use shared_entity::response::{AppResponse, AppResponseError}; use std::pin::Pin; use std::task::{Context, Poll}; +use std::time::Duration; use tracing::error; impl Client { @@ -111,6 +112,7 @@ impl Client { let resp = self .http_client_with_auth(Method::GET, &url) .await? + .timeout(Duration::from_secs(30)) .send() .await?; log_request_id(&resp); @@ -130,6 +132,7 @@ impl Client { let resp = self .http_client_with_auth(Method::GET, &url) .await? + .timeout(Duration::from_secs(30)) .send() .await?; log_request_id(&resp);