uipath-llm-client 1.0.2__py3-none-any.whl → 1.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uipath_llm_client/__version__.py +1 -1
- uipath_llm_client/clients/openai/client.py +4 -4
- uipath_llm_client/httpx_client.py +3 -3
- uipath_llm_client/utils/retry.py +3 -3
- uipath_llm_client/utils/ssl_config.py +54 -0
- {uipath_llm_client-1.0.2.dist-info → uipath_llm_client-1.0.4.dist-info}/METADATA +2 -2
- {uipath_llm_client-1.0.2.dist-info → uipath_llm_client-1.0.4.dist-info}/RECORD +9 -8
- {uipath_llm_client-1.0.2.dist-info → uipath_llm_client-1.0.4.dist-info}/WHEEL +0 -0
- {uipath_llm_client-1.0.2.dist-info → uipath_llm_client-1.0.4.dist-info}/licenses/LICENSE +0 -0
uipath_llm_client/__version__.py
CHANGED
|
@@ -51,7 +51,7 @@ class UiPathOpenAI(OpenAI):
|
|
|
51
51
|
super().__init__(
|
|
52
52
|
api_key="PLACEHOLDER",
|
|
53
53
|
timeout=None,
|
|
54
|
-
max_retries=
|
|
54
|
+
max_retries=0,
|
|
55
55
|
http_client=httpx_client,
|
|
56
56
|
)
|
|
57
57
|
|
|
@@ -91,7 +91,7 @@ class UiPathAsyncOpenAI(AsyncOpenAI):
|
|
|
91
91
|
super().__init__(
|
|
92
92
|
api_key="PLACEHOLDER",
|
|
93
93
|
timeout=None,
|
|
94
|
-
max_retries=
|
|
94
|
+
max_retries=0,
|
|
95
95
|
http_client=httpx_client,
|
|
96
96
|
)
|
|
97
97
|
|
|
@@ -133,7 +133,7 @@ class UiPathAzureOpenAI(AzureOpenAI):
|
|
|
133
133
|
api_version="PLACEHOLDER",
|
|
134
134
|
api_key="PLACEHOLDER",
|
|
135
135
|
timeout=None,
|
|
136
|
-
max_retries=
|
|
136
|
+
max_retries=0,
|
|
137
137
|
http_client=httpx_client,
|
|
138
138
|
)
|
|
139
139
|
|
|
@@ -175,6 +175,6 @@ class UiPathAsyncAzureOpenAI(AsyncAzureOpenAI):
|
|
|
175
175
|
api_version="PLACEHOLDER",
|
|
176
176
|
api_key="PLACEHOLDER",
|
|
177
177
|
timeout=None,
|
|
178
|
-
max_retries=
|
|
178
|
+
max_retries=0,
|
|
179
179
|
http_client=httpx_client,
|
|
180
180
|
)
|
|
@@ -35,7 +35,6 @@ from httpx import (
|
|
|
35
35
|
Response,
|
|
36
36
|
)
|
|
37
37
|
from httpx._types import HeaderTypes
|
|
38
|
-
from uipath._utils._ssl_context import get_httpx_client_kwargs
|
|
39
38
|
|
|
40
39
|
from uipath_llm_client.settings import (
|
|
41
40
|
UiPathAPIConfig,
|
|
@@ -47,6 +46,7 @@ from uipath_llm_client.utils.retry import (
|
|
|
47
46
|
RetryableHTTPTransport,
|
|
48
47
|
RetryConfig,
|
|
49
48
|
)
|
|
49
|
+
from uipath_llm_client.utils.ssl_config import get_httpx_client_kwargs
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
def build_routing_headers(
|
|
@@ -152,7 +152,7 @@ class UiPathHttpxClient(Client):
|
|
|
152
152
|
# Setup retry transport if not provided
|
|
153
153
|
if transport is None:
|
|
154
154
|
transport = RetryableHTTPTransport(
|
|
155
|
-
max_retries=max_retries or
|
|
155
|
+
max_retries=max_retries or 0,
|
|
156
156
|
retry_config=retry_config,
|
|
157
157
|
logger=logger,
|
|
158
158
|
)
|
|
@@ -272,7 +272,7 @@ class UiPathHttpxAsyncClient(AsyncClient):
|
|
|
272
272
|
# Setup retry transport if not provided
|
|
273
273
|
if transport is None:
|
|
274
274
|
transport = RetryableAsyncHTTPTransport(
|
|
275
|
-
max_retries=max_retries or
|
|
275
|
+
max_retries=max_retries or 0,
|
|
276
276
|
retry_config=retry_config,
|
|
277
277
|
logger=logger,
|
|
278
278
|
)
|
uipath_llm_client/utils/retry.py
CHANGED
|
@@ -108,7 +108,7 @@ def _build_retryer(
|
|
|
108
108
|
Returns:
|
|
109
109
|
A configured Retrying/AsyncRetrying instance, or None if retries disabled.
|
|
110
110
|
"""
|
|
111
|
-
if max_retries
|
|
111
|
+
if max_retries < 1:
|
|
112
112
|
return None
|
|
113
113
|
|
|
114
114
|
cfg = retry_config or {}
|
|
@@ -152,7 +152,7 @@ class RetryableHTTPTransport(HTTPTransport):
|
|
|
152
152
|
def __init__(
|
|
153
153
|
self,
|
|
154
154
|
*args: Any,
|
|
155
|
-
max_retries: int =
|
|
155
|
+
max_retries: int = 0,
|
|
156
156
|
retry_config: RetryConfig | None = None,
|
|
157
157
|
logger: logging.Logger | None = None,
|
|
158
158
|
**kwargs: Any,
|
|
@@ -216,7 +216,7 @@ class RetryableAsyncHTTPTransport(AsyncHTTPTransport):
|
|
|
216
216
|
def __init__(
|
|
217
217
|
self,
|
|
218
218
|
*args: Any,
|
|
219
|
-
max_retries: int =
|
|
219
|
+
max_retries: int = 0,
|
|
220
220
|
retry_config: RetryConfig | None = None,
|
|
221
221
|
logger: logging.Logger | None = None,
|
|
222
222
|
**kwargs: Any,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import ssl
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def expand_path(path):
|
|
7
|
+
"""Expand environment variables and user home directory in path."""
|
|
8
|
+
if not path:
|
|
9
|
+
return path
|
|
10
|
+
# Expand environment variables like $HOME
|
|
11
|
+
path = os.path.expandvars(path)
|
|
12
|
+
# Expand user home directory ~
|
|
13
|
+
path = os.path.expanduser(path)
|
|
14
|
+
return path
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def create_ssl_context():
|
|
18
|
+
# Try truststore first (system certificates)
|
|
19
|
+
try:
|
|
20
|
+
import truststore
|
|
21
|
+
|
|
22
|
+
return truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
|
|
23
|
+
except ImportError:
|
|
24
|
+
# Fallback to manual certificate configuration
|
|
25
|
+
import certifi
|
|
26
|
+
|
|
27
|
+
ssl_cert_file = expand_path(os.environ.get("SSL_CERT_FILE"))
|
|
28
|
+
requests_ca_bundle = expand_path(os.environ.get("REQUESTS_CA_BUNDLE"))
|
|
29
|
+
ssl_cert_dir = expand_path(os.environ.get("SSL_CERT_DIR"))
|
|
30
|
+
|
|
31
|
+
return ssl.create_default_context(
|
|
32
|
+
cafile=ssl_cert_file or requests_ca_bundle or certifi.where(),
|
|
33
|
+
capath=ssl_cert_dir,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def get_httpx_client_kwargs() -> dict[str, Any]:
|
|
38
|
+
"""Get standardized httpx client configuration."""
|
|
39
|
+
client_kwargs: dict[str, Any] = {"follow_redirects": True, "timeout": 30.0}
|
|
40
|
+
|
|
41
|
+
# Check environment variable to disable SSL verification
|
|
42
|
+
disable_ssl_env = os.environ.get("UIPATH_DISABLE_SSL_VERIFY", "").lower()
|
|
43
|
+
disable_ssl_from_env = disable_ssl_env in ("1", "true", "yes", "on")
|
|
44
|
+
|
|
45
|
+
if disable_ssl_from_env:
|
|
46
|
+
client_kwargs["verify"] = False
|
|
47
|
+
else:
|
|
48
|
+
# Use system certificates with truststore fallback
|
|
49
|
+
client_kwargs["verify"] = create_ssl_context()
|
|
50
|
+
|
|
51
|
+
# Auto-detect proxy from environment variables (httpx handles this automatically)
|
|
52
|
+
# HTTP_PROXY, HTTPS_PROXY, NO_PROXY are read by httpx by default
|
|
53
|
+
|
|
54
|
+
return client_kwargs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath-llm-client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: UiPath LLM Client
|
|
5
5
|
Author-email: Cosmin Maria <cosmin.maria@uipath.com>, Dragos Bobolea <dragos.bobolea@uipath.com>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -589,7 +589,7 @@ byo_embeddings = UiPathAzureOpenAIEmbeddings(
|
|
|
589
589
|
# Clone and install with dev dependencies
|
|
590
590
|
git clone https://github.com/UiPath/uipath-llm-client.git
|
|
591
591
|
cd uipath-llm-client
|
|
592
|
-
uv sync
|
|
592
|
+
uv sync
|
|
593
593
|
|
|
594
594
|
# Run tests
|
|
595
595
|
uv run pytest
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
uipath_llm_client/__init__.py,sha256=K7pMecLOblh6GWVBkoOalC-ho5ozlw3WG6loiJNzSFo,2363
|
|
2
|
-
uipath_llm_client/__version__.py,sha256=
|
|
3
|
-
uipath_llm_client/httpx_client.py,sha256=
|
|
2
|
+
uipath_llm_client/__version__.py,sha256=pWHtmmJRN_K9orqRQrqJ_mA8wnFVkj97oHjJ57-_vvg,135
|
|
3
|
+
uipath_llm_client/httpx_client.py,sha256=kr7zKv0GwntCgxjvqN-3x35-OTMw2VthY9o7WNUKzZQ,12760
|
|
4
4
|
uipath_llm_client/clients/anthropic/__init__.py,sha256=0KxbVGKSVWwC89PYPM7IXkP3qhJa2J0zyW6xsr0efWM,546
|
|
5
5
|
uipath_llm_client/clients/anthropic/client.py,sha256=UjrXzsgOOgoIRjo7SiLThWtXAJIEH-BHuPy3umNcmC0,17967
|
|
6
6
|
uipath_llm_client/clients/google/__init__.py,sha256=_JRzU_RdUnWvpPdeAOpWjUb-ccN2TBcReXCFF34Ouyw,100
|
|
7
7
|
uipath_llm_client/clients/google/client.py,sha256=tQSvQ6VF5sG1UGHtnMSEzXXMwiMl2wQi12BotP-pkF4,3103
|
|
8
8
|
uipath_llm_client/clients/openai/__init__.py,sha256=aopqE4oac6lukGxp46t7ZlsOebeavkneGvYln5zUddc,263
|
|
9
|
-
uipath_llm_client/clients/openai/client.py,sha256=
|
|
9
|
+
uipath_llm_client/clients/openai/client.py,sha256=GkmMRwqJcqqZa-NfQJP7-3tuhHdTmWC6Y2f8zwYReZw,6198
|
|
10
10
|
uipath_llm_client/clients/openai/utils.py,sha256=pZibM2buLiKRrLd1oa1uGtelJEACl65ZOLjF8azz70w,2863
|
|
11
11
|
uipath_llm_client/settings/__init__.py,sha256=dTXrUcOHH6WhLZouWVVSKy8RVb8hoGosbmNYEmL51Sw,2870
|
|
12
12
|
uipath_llm_client/settings/base.py,sha256=rVloAQCvbhY-bBdKEOH5WuB-pay91BZ9gpNXT0uQFIA,4620
|
|
@@ -20,8 +20,9 @@ uipath_llm_client/settings/llmgateway/settings.py,sha256=ZhKk94UP2yJ6MNR8mSRWmoq
|
|
|
20
20
|
uipath_llm_client/settings/llmgateway/utils.py,sha256=gqyZXulcG0ifvlaxqdOGkf24jOtjCAalBme26BmoV3Q,527
|
|
21
21
|
uipath_llm_client/utils/exceptions.py,sha256=IcHPQIf-Jzir_rG7gaD7ByD25Thcl-QpAjnC6xvZ0qQ,5973
|
|
22
22
|
uipath_llm_client/utils/logging.py,sha256=pmC00QAt4LVXFb6PCHQDPoX7iLE9N2GeEytuAkUiQ1w,4641
|
|
23
|
-
uipath_llm_client/utils/retry.py,sha256=
|
|
24
|
-
uipath_llm_client
|
|
25
|
-
uipath_llm_client-1.0.
|
|
26
|
-
uipath_llm_client-1.0.
|
|
27
|
-
uipath_llm_client-1.0.
|
|
23
|
+
uipath_llm_client/utils/retry.py,sha256=dCWjucI6RtXrjvE0i4YpwQOOwd3d89FZ7MFLwxRSs_s,8602
|
|
24
|
+
uipath_llm_client/utils/ssl_config.py,sha256=N-XGdZ93bWLJLwgIHkI9YD58QiB6lzVvgNT97q0dmF8,1777
|
|
25
|
+
uipath_llm_client-1.0.4.dist-info/METADATA,sha256=7-67NMYhZNXs_Ib_oMawxjnQgui_QF9s45YtnTeQn6Y,22958
|
|
26
|
+
uipath_llm_client-1.0.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
27
|
+
uipath_llm_client-1.0.4.dist-info/licenses/LICENSE,sha256=r4HMU0pdnVI7BlSYgDUCszn7IrCXJiN8o3yt2U1aOpc,375
|
|
28
|
+
uipath_llm_client-1.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|