Skip to content

Commit 6733982

Browse files
authored
Fix Langchain OpenAI timout issues and set new llmgw timeout default (#7)
1 parent 287ca44 commit 6733982

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

packages/uipath_langchain_client/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to `uipath_langchain_client` will be documented in this file.
44

5+
## [1.0.4] - 2026-02-03
6+
7+
### Bug Fix
8+
- Fix some timout issues on langchain_openai from llmgw.
9+
510
## [1.0.3] - 2026-02-02
611

712
### Bug Fix
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__title__ = "UiPath LangChain Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services via LangChain."
3-
__version__ = "1.0.3"
3+
__version__ = "1.0.4"

packages/uipath_langchain_client/src/uipath_langchain_client/base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class UiPathBaseLLMClient(BaseModel):
9090
)
9191
default_headers: Mapping[str, str] | None = Field(
9292
default={
93-
"X-UiPath-LLMGateway-TimeoutSeconds": "30", # server side timeout, default is 10, maximum is 300
93+
"X-UiPath-LLMGateway-TimeoutSeconds": "300", # server side timeout, default is 10, maximum is 300
9494
"X-UiPath-LLMGateway-AllowFull4xxResponse": "true", # allow full 4xx responses (default is false)
9595
},
9696
description="Default request headers to include in requests",

packages/uipath_langchain_client/src/uipath_langchain_client/clients/openai/chat_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ def setup_uipath_client(self) -> Self:
4343
self.root_client = OpenAI(
4444
api_key="PLACEHOLDER",
4545
timeout=None, # handled by the UiPath client
46-
max_retries=1, # handled by the UiPath client
46+
max_retries=0, # handled by the UiPath client
4747
http_client=self.uipath_sync_client,
4848
)
4949
self.root_async_client = AsyncOpenAI(
5050
api_key="PLACEHOLDER",
5151
timeout=None, # handled by the UiPath client
52-
max_retries=1, # handled by the UiPath client
52+
max_retries=0, # handled by the UiPath client
5353
http_client=self.uipath_async_client,
5454
)
5555
self.client = self.root_client.chat.completions
@@ -86,15 +86,15 @@ def setup_uipath_client(self) -> Self:
8686
api_version="PLACEHOLDER",
8787
api_key="PLACEHOLDER",
8888
timeout=None, # handled by the UiPath client
89-
max_retries=1, # handled by the UiPath client
89+
max_retries=0, # handled by the UiPath client
9090
http_client=self.uipath_sync_client,
9191
)
9292
self.root_async_client = AsyncAzureOpenAI(
9393
azure_endpoint="PLACEHOLDER",
9494
api_version="PLACEHOLDER",
9595
api_key="PLACEHOLDER",
9696
timeout=None, # handled by the UiPath client
97-
max_retries=1, # handled by the UiPath client
97+
max_retries=0, # handled by the UiPath client
9898
http_client=self.uipath_async_client,
9999
)
100100
self.client = self.root_client.chat.completions

packages/uipath_langchain_client/src/uipath_langchain_client/clients/openai/embeddings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ def setup_uipath_client(self) -> Self:
3636
self.client = OpenAI(
3737
api_key="PLACEHOLDER",
3838
timeout=None, # handled by the UiPath client
39-
max_retries=1, # handled by the UiPath client
39+
max_retries=0, # handled by the UiPath client
4040
http_client=self.uipath_sync_client,
4141
).embeddings
4242
self.async_client = AsyncOpenAI(
4343
api_key="PLACEHOLDER",
4444
timeout=None, # handled by the UiPath client
45-
max_retries=1, # handled by the UiPath client
45+
max_retries=0, # handled by the UiPath client
4646
http_client=self.uipath_async_client,
4747
).embeddings
4848
return self
@@ -70,15 +70,15 @@ def setup_uipath_client(self) -> Self:
7070
api_version="PLACEHOLDER",
7171
api_key="PLACEHOLDER",
7272
timeout=None, # handled by the UiPath client
73-
max_retries=1, # handled by the UiPath client
73+
max_retries=0, # handled by the UiPath client
7474
http_client=self.uipath_sync_client,
7575
).embeddings
7676
self.async_client = AsyncAzureOpenAI(
7777
azure_endpoint="PLACEHOLDER",
7878
api_version="PLACEHOLDER",
7979
api_key="PLACEHOLDER",
8080
timeout=None, # handled by the UiPath client
81-
max_retries=1, # handled by the UiPath client
81+
max_retries=0, # handled by the UiPath client
8282
http_client=self.uipath_async_client,
8383
).embeddings
8484
return self

0 commit comments

Comments
 (0)