uipath-langchain 0.0.116__py3-none-any.whl → 0.0.117__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.
Potentially problematic release.
This version of uipath-langchain might be problematic. Click here for more details.
- uipath_langchain/_utils/_request_mixin.py +2 -0
- uipath_langchain/_utils/_settings.py +0 -9
- uipath_langchain/chat/models.py +22 -3
- uipath_langchain/embeddings/embeddings.py +5 -3
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.117.dist-info}/METADATA +2 -2
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.117.dist-info}/RECORD +9 -9
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.117.dist-info}/WHEEL +0 -0
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.117.dist-info}/entry_points.txt +0 -0
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.117.dist-info}/licenses/LICENSE +0 -0
|
@@ -40,6 +40,8 @@ class UiPathRequestMixin(BaseModel):
|
|
|
40
40
|
|
|
41
41
|
default_headers: Optional[Mapping[str, str]] = {
|
|
42
42
|
"X-UiPath-Streaming-Enabled": "false",
|
|
43
|
+
"X-UiPath-JobKey": os.getenv("UIPATH_JOB_KEY", ""),
|
|
44
|
+
"X-UiPath-ProcessKey": os.getenv("UIPATH_PROCESS_KEY", ""),
|
|
43
45
|
}
|
|
44
46
|
model_name: Optional[str] = Field(
|
|
45
47
|
default_factory=lambda: os.getenv("UIPATH_MODEL_NAME", "gpt-4o-2024-08-06"),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# mypy: disable-error-code="syntax"
|
|
2
2
|
import os
|
|
3
|
-
from enum import Enum
|
|
4
3
|
from typing import Any, Optional
|
|
5
4
|
|
|
6
5
|
import httpx
|
|
@@ -47,14 +46,6 @@ class UiPathClientSettings(BaseSettings):
|
|
|
47
46
|
action_id: str = Field(default="DefaultActionId", alias="UIPATH_ACTION_ID")
|
|
48
47
|
|
|
49
48
|
|
|
50
|
-
class UiPathEndpoints(Enum):
|
|
51
|
-
NORMALIZED_COMPLETION_ENDPOINT = "llmgateway_/api/chat/completions"
|
|
52
|
-
PASSTHROUGH_COMPLETION_ENDPOINT = "llmgateway_/openai/deployments/{model}/chat/completions?api-version={api_version}"
|
|
53
|
-
EMBEDDING_ENDPOINT = (
|
|
54
|
-
"llmgateway_/openai/deployments/{model}/embeddings?api-version={api_version}"
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
|
|
58
49
|
def get_uipath_token_header(
|
|
59
50
|
settings: Any = None,
|
|
60
51
|
) -> str:
|
uipath_langchain/chat/models.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import logging
|
|
3
|
+
from os import environ as env
|
|
2
4
|
from typing import Any, Dict, List, Literal, Optional, Union
|
|
3
5
|
|
|
4
6
|
from langchain_core.callbacks import (
|
|
@@ -12,9 +14,11 @@ from langchain_core.outputs import ChatGeneration, ChatResult
|
|
|
12
14
|
from langchain_core.runnables import Runnable
|
|
13
15
|
from langchain_openai.chat_models import AzureChatOpenAI
|
|
14
16
|
from pydantic import BaseModel
|
|
17
|
+
from uipath.utils import EndpointManager
|
|
15
18
|
|
|
16
19
|
from uipath_langchain._utils._request_mixin import UiPathRequestMixin
|
|
17
|
-
|
|
20
|
+
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
18
22
|
|
|
19
23
|
|
|
20
24
|
class UiPathAzureChatOpenAI(UiPathRequestMixin, AzureChatOpenAI):
|
|
@@ -71,7 +75,9 @@ class UiPathAzureChatOpenAI(UiPathRequestMixin, AzureChatOpenAI):
|
|
|
71
75
|
|
|
72
76
|
@property
|
|
73
77
|
def endpoint(self) -> str:
|
|
74
|
-
|
|
78
|
+
endpoint = EndpointManager.get_passthrough_endpoint()
|
|
79
|
+
logger.debug("Using endpoint: %s", endpoint)
|
|
80
|
+
return endpoint.format(
|
|
75
81
|
model=self.model_name, api_version=self.openai_api_version
|
|
76
82
|
)
|
|
77
83
|
|
|
@@ -79,6 +85,15 @@ class UiPathAzureChatOpenAI(UiPathRequestMixin, AzureChatOpenAI):
|
|
|
79
85
|
class UiPathChat(UiPathRequestMixin, AzureChatOpenAI):
|
|
80
86
|
"""Custom LLM connector for LangChain integration with UiPath Normalized."""
|
|
81
87
|
|
|
88
|
+
def __init__(self, *args: Any, **kwargs: Any):
|
|
89
|
+
"""Initialize the UiPath Azure Chat OpenAI model."""
|
|
90
|
+
|
|
91
|
+
super().__init__(*args, **kwargs)
|
|
92
|
+
self.default_headers = {
|
|
93
|
+
"X-UiPath-JobKey": env.get("UIPATH_JOB_KEY", ""),
|
|
94
|
+
"X-UiPath-ProcessKey": env.get("UIPATH_PROCESS_KEY", ""),
|
|
95
|
+
}
|
|
96
|
+
|
|
82
97
|
def _create_chat_result(
|
|
83
98
|
self,
|
|
84
99
|
response: Union[Dict[str, Any], BaseModel],
|
|
@@ -252,7 +267,11 @@ class UiPathChat(UiPathRequestMixin, AzureChatOpenAI):
|
|
|
252
267
|
|
|
253
268
|
@property
|
|
254
269
|
def endpoint(self) -> str:
|
|
255
|
-
|
|
270
|
+
endpoint = EndpointManager.get_passthrough_endpoint()
|
|
271
|
+
logger.debug("Using endpoint: %s", endpoint)
|
|
272
|
+
return endpoint.format(
|
|
273
|
+
model=self.model_name, api_version=self.openai_api_version
|
|
274
|
+
)
|
|
256
275
|
|
|
257
276
|
@property
|
|
258
277
|
def is_normalized(self) -> bool:
|
|
@@ -5,9 +5,9 @@ import httpx
|
|
|
5
5
|
from langchain_community.callbacks.manager import openai_callback_var
|
|
6
6
|
from langchain_openai.embeddings import AzureOpenAIEmbeddings, OpenAIEmbeddings
|
|
7
7
|
from pydantic import Field
|
|
8
|
+
from uipath.utils import EndpointManager
|
|
8
9
|
|
|
9
10
|
from uipath_langchain._utils._request_mixin import UiPathRequestMixin
|
|
10
|
-
from uipath_langchain._utils._settings import UiPathEndpoints
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class UiPathAzureOpenAIEmbeddings(UiPathRequestMixin, AzureOpenAIEmbeddings):
|
|
@@ -43,7 +43,8 @@ class UiPathAzureOpenAIEmbeddings(UiPathRequestMixin, AzureOpenAIEmbeddings):
|
|
|
43
43
|
|
|
44
44
|
@property
|
|
45
45
|
def endpoint(self) -> str:
|
|
46
|
-
|
|
46
|
+
endpoint = EndpointManager.get_embeddings_endpoint()
|
|
47
|
+
return endpoint.format(
|
|
47
48
|
model=self.model_name, api_version=self.openai_api_version
|
|
48
49
|
)
|
|
49
50
|
|
|
@@ -105,6 +106,7 @@ class UiPathOpenAIEmbeddings(UiPathRequestMixin, OpenAIEmbeddings):
|
|
|
105
106
|
|
|
106
107
|
@property
|
|
107
108
|
def endpoint(self) -> str:
|
|
108
|
-
|
|
109
|
+
endpoint = EndpointManager.get_embeddings_endpoint()
|
|
110
|
+
return endpoint.format(
|
|
109
111
|
model=self.model_name, api_version=self.openai_api_version
|
|
110
112
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath-langchain
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.117
|
|
4
4
|
Summary: UiPath Langchain
|
|
5
5
|
Project-URL: Homepage, https://uipath.com
|
|
6
6
|
Project-URL: Repository, https://github.com/UiPath/uipath-langchain-python
|
|
@@ -24,7 +24,7 @@ Requires-Dist: langgraph>=0.2.70
|
|
|
24
24
|
Requires-Dist: openai>=1.65.5
|
|
25
25
|
Requires-Dist: pydantic-settings>=2.6.0
|
|
26
26
|
Requires-Dist: python-dotenv>=1.0.1
|
|
27
|
-
Requires-Dist: uipath<2.1.0,>=2.0.
|
|
27
|
+
Requires-Dist: uipath<2.1.0,>=2.0.79
|
|
28
28
|
Provides-Extra: langchain
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
30
30
|
|
|
@@ -13,13 +13,13 @@ uipath_langchain/_cli/_templates/langgraph.json.template,sha256=eeh391Gta_hoRgaN
|
|
|
13
13
|
uipath_langchain/_cli/_templates/main.py.template,sha256=nMJQIYPlRk90iANfNVpkJ2EQX20Dxsyq92-BucEz_UM,1189
|
|
14
14
|
uipath_langchain/_cli/_utils/_graph.py,sha256=2FrlU4bMuEzcHglXzIC54IB8jw55SlENF-SVcpwWsS0,7167
|
|
15
15
|
uipath_langchain/_utils/__init__.py,sha256=WoY66enCygRXTh6v5B1UrRcFCnQYuPJ8oqDkwomXzLc,194
|
|
16
|
-
uipath_langchain/_utils/_request_mixin.py,sha256=
|
|
17
|
-
uipath_langchain/_utils/_settings.py,sha256=
|
|
16
|
+
uipath_langchain/_utils/_request_mixin.py,sha256=Bf8l43T0uqwUsucBE_2C1aeB9b0bmf11-3SyKr6RNpA,18926
|
|
17
|
+
uipath_langchain/_utils/_settings.py,sha256=2fExMQJ88YptfldmzMfZIpsx-m1gfMkeYGf5t6KIe0A,3084
|
|
18
18
|
uipath_langchain/_utils/_sleep_policy.py,sha256=e9pHdjmcCj4CVoFM1jMyZFelH11YatsgWfpyrfXzKBQ,1251
|
|
19
19
|
uipath_langchain/chat/__init__.py,sha256=WDcvy91ixvZ3Mq7Ae94g5CjyQwXovDBnEv1NlD5SXBE,116
|
|
20
|
-
uipath_langchain/chat/models.py,sha256=
|
|
20
|
+
uipath_langchain/chat/models.py,sha256=cUxBR39oHIFkRifLNVRHjff6QXGiOcTzy9J-svnKGsE,10848
|
|
21
21
|
uipath_langchain/embeddings/__init__.py,sha256=QICtYB58ZyqFfDQrEaO8lTEgAU5NuEKlR7iIrS0OBtc,156
|
|
22
|
-
uipath_langchain/embeddings/embeddings.py,sha256=
|
|
22
|
+
uipath_langchain/embeddings/embeddings.py,sha256=45gKyb6HVKigwE-0CXeZcAk33c0mteaEdPGa8hviqcw,4339
|
|
23
23
|
uipath_langchain/retrievers/__init__.py,sha256=rOn7PyyHgZ4pMnXWPkGqmuBmx8eGuo-Oyndo7Wm9IUU,108
|
|
24
24
|
uipath_langchain/retrievers/context_grounding_retriever.py,sha256=YLCIwy89LhLnNqcM0YJ5mZoeNyCs5UiKD3Wly8gnW1E,2239
|
|
25
25
|
uipath_langchain/tracers/AsyncUiPathTracer.py,sha256=SgFLVU8ZtRaUjIiiM5jjYqlKc-4ec3tAXwZVceDM2ng,9147
|
|
@@ -29,8 +29,8 @@ uipath_langchain/tracers/_instrument_traceable.py,sha256=0e841zVzcPWjOGtmBx0GeHb
|
|
|
29
29
|
uipath_langchain/tracers/_utils.py,sha256=JOT1tKMdvqjMDtj2WbmbOWMeMlTXBWavxWpogX7KlRA,1543
|
|
30
30
|
uipath_langchain/vectorstores/__init__.py,sha256=w8qs1P548ud1aIcVA_QhBgf_jZDrRMK5Lono78yA8cs,114
|
|
31
31
|
uipath_langchain/vectorstores/context_grounding_vectorstore.py,sha256=TncIXG-YsUlO0R5ZYzWsM-Dj1SVCZbzmo2LraVxXelc,9559
|
|
32
|
-
uipath_langchain-0.0.
|
|
33
|
-
uipath_langchain-0.0.
|
|
34
|
-
uipath_langchain-0.0.
|
|
35
|
-
uipath_langchain-0.0.
|
|
36
|
-
uipath_langchain-0.0.
|
|
32
|
+
uipath_langchain-0.0.117.dist-info/METADATA,sha256=dJQDa40PA6Np0h_JvSRLbcMlHTiZo6a_Zh8mP5_5XPc,4166
|
|
33
|
+
uipath_langchain-0.0.117.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
34
|
+
uipath_langchain-0.0.117.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
|
|
35
|
+
uipath_langchain-0.0.117.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
|
|
36
|
+
uipath_langchain-0.0.117.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|