uipath-llm-client 1.0.2__py3-none-any.whl → 1.0.3__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/httpx_client.py +1 -1
- uipath_llm_client/utils/ssl_config.py +54 -0
- {uipath_llm_client-1.0.2.dist-info → uipath_llm_client-1.0.3.dist-info}/METADATA +1 -1
- {uipath_llm_client-1.0.2.dist-info → uipath_llm_client-1.0.3.dist-info}/RECORD +7 -6
- {uipath_llm_client-1.0.2.dist-info → uipath_llm_client-1.0.3.dist-info}/WHEEL +0 -0
- {uipath_llm_client-1.0.2.dist-info → uipath_llm_client-1.0.3.dist-info}/licenses/LICENSE +0 -0
uipath_llm_client/__version__.py
CHANGED
|
@@ -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(
|
|
@@ -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
|
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=MlmzOSirL7w4RNOuT9_Z54kuvZOTZ4YXnsxVWwTrUR8,135
|
|
3
|
+
uipath_llm_client/httpx_client.py,sha256=yh9AT5_1jJzcrDfpfLmG3Th6r8Rps2zLwSTQMyI9lBg,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
|
|
@@ -21,7 +21,8 @@ uipath_llm_client/settings/llmgateway/utils.py,sha256=gqyZXulcG0ifvlaxqdOGkf24jO
|
|
|
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
23
|
uipath_llm_client/utils/retry.py,sha256=cvM-OBEvga6mufCQ5G9rmxVzd33wOJOO6UGOHs9IWgk,8603
|
|
24
|
-
uipath_llm_client
|
|
25
|
-
uipath_llm_client-1.0.
|
|
26
|
-
uipath_llm_client-1.0.
|
|
27
|
-
uipath_llm_client-1.0.
|
|
24
|
+
uipath_llm_client/utils/ssl_config.py,sha256=N-XGdZ93bWLJLwgIHkI9YD58QiB6lzVvgNT97q0dmF8,1777
|
|
25
|
+
uipath_llm_client-1.0.3.dist-info/METADATA,sha256=UKoUMKlX-LC5FtFERWW4ESUXPckj5iRmnmlnWQVPi3Y,22964
|
|
26
|
+
uipath_llm_client-1.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
27
|
+
uipath_llm_client-1.0.3.dist-info/licenses/LICENSE,sha256=r4HMU0pdnVI7BlSYgDUCszn7IrCXJiN8o3yt2U1aOpc,375
|
|
28
|
+
uipath_llm_client-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|