uipath-langchain 0.0.116__py3-none-any.whl → 0.0.118__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 +12 -3
- uipath_langchain/embeddings/embeddings.py +5 -3
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.118.dist-info}/METADATA +2 -2
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.118.dist-info}/RECORD +9 -9
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.118.dist-info}/WHEEL +0 -0
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.118.dist-info}/entry_points.txt +0 -0
- {uipath_langchain-0.0.116.dist-info → uipath_langchain-0.0.118.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,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import logging
|
|
2
3
|
from typing import Any, Dict, List, Literal, Optional, Union
|
|
3
4
|
|
|
4
5
|
from langchain_core.callbacks import (
|
|
@@ -12,9 +13,11 @@ from langchain_core.outputs import ChatGeneration, ChatResult
|
|
|
12
13
|
from langchain_core.runnables import Runnable
|
|
13
14
|
from langchain_openai.chat_models import AzureChatOpenAI
|
|
14
15
|
from pydantic import BaseModel
|
|
16
|
+
from uipath.utils import EndpointManager
|
|
15
17
|
|
|
16
18
|
from uipath_langchain._utils._request_mixin import UiPathRequestMixin
|
|
17
|
-
|
|
19
|
+
|
|
20
|
+
logger = logging.getLogger(__name__)
|
|
18
21
|
|
|
19
22
|
|
|
20
23
|
class UiPathAzureChatOpenAI(UiPathRequestMixin, AzureChatOpenAI):
|
|
@@ -71,7 +74,9 @@ class UiPathAzureChatOpenAI(UiPathRequestMixin, AzureChatOpenAI):
|
|
|
71
74
|
|
|
72
75
|
@property
|
|
73
76
|
def endpoint(self) -> str:
|
|
74
|
-
|
|
77
|
+
endpoint = EndpointManager.get_passthrough_endpoint()
|
|
78
|
+
logger.debug("Using endpoint: %s", endpoint)
|
|
79
|
+
return endpoint.format(
|
|
75
80
|
model=self.model_name, api_version=self.openai_api_version
|
|
76
81
|
)
|
|
77
82
|
|
|
@@ -252,7 +257,11 @@ class UiPathChat(UiPathRequestMixin, AzureChatOpenAI):
|
|
|
252
257
|
|
|
253
258
|
@property
|
|
254
259
|
def endpoint(self) -> str:
|
|
255
|
-
|
|
260
|
+
endpoint = EndpointManager.get_normalized_endpoint()
|
|
261
|
+
logger.debug("Using endpoint: %s", endpoint)
|
|
262
|
+
return endpoint.format(
|
|
263
|
+
model=self.model_name, api_version=self.openai_api_version
|
|
264
|
+
)
|
|
256
265
|
|
|
257
266
|
@property
|
|
258
267
|
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.118
|
|
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=KZOV29OZNpQQoR94S1NnVenaahCyB4LNQ7wjGti4LNk,10486
|
|
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.118.dist-info/METADATA,sha256=XmjUDeowztK63ZCNkzVSbmt4xbFeG17MxtwJxpHXgKA,4166
|
|
33
|
+
uipath_langchain-0.0.118.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
34
|
+
uipath_langchain-0.0.118.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
|
|
35
|
+
uipath_langchain-0.0.118.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
|
|
36
|
+
uipath_langchain-0.0.118.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|