uipath-langchain 0.0.76__tar.gz → 0.0.78__tar.gz
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_langchain-0.0.76 → uipath_langchain-0.0.78}/PKG-INFO +2 -2
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/pyproject.toml +2 -2
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_escalation.py +2 -2
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_input.py +1 -1
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_output.py +55 -22
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/tracers/AsyncUiPathTracer.py +4 -2
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/tracers/UiPathTracer.py +3 -1
- uipath_langchain-0.0.78/uipath_langchain/tracers/_utils.py +24 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/.gitignore +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/README.md +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/__init__.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/__init__.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_context.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_exception.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_runtime.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_utils/_graph.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/cli_init.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/cli_run.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/__init__.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/_request_mixin.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/_settings.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/_sleep_policy.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/tests/cached_embeddings/text-embedding-3-large5034ec3c-85c9-54b8-ac89-5e0cbcf99e3b +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/tests/cached_embeddings/text-embedding-3-largec48857ed-1302-5954-9e24-69fa9b45e457 +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/tests/tests_uipath_cache.db +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/chat/__init__.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/chat/models.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/chat/utils/__init__.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/chat/utils/_chat_types.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/embeddings/__init__.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/embeddings/embeddings.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/middlewares.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/retrievers/__init__.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/retrievers/context_grounding_retriever.py +0 -0
- {uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/tracers/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath-langchain
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.78
|
|
4
4
|
Summary: UiPath Langchain
|
|
5
5
|
Project-URL: Homepage, https://uipath.com
|
|
6
6
|
Project-URL: Repository, https://github.com/UiPath/uipath-python
|
|
@@ -25,5 +25,5 @@ Requires-Dist: pydantic-settings>=2.6.0
|
|
|
25
25
|
Requires-Dist: python-dotenv>=1.0.1
|
|
26
26
|
Requires-Dist: requests>=2.23.3
|
|
27
27
|
Requires-Dist: types-requests>=2.32.0.20241016
|
|
28
|
-
Requires-Dist: uipath-sdk>=0.0.
|
|
28
|
+
Requires-Dist: uipath-sdk>=0.0.106
|
|
29
29
|
Provides-Extra: langchain
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "uipath-langchain"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.78"
|
|
4
4
|
description = "UiPath Langchain"
|
|
5
5
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
6
6
|
requires-python = ">=3.9"
|
|
7
7
|
dependencies = [
|
|
8
|
-
"uipath-sdk>=0.0.
|
|
8
|
+
"uipath-sdk>=0.0.106",
|
|
9
9
|
"langgraph>=0.2.70",
|
|
10
10
|
"langchain-core>=0.3.34",
|
|
11
11
|
"langgraph-checkpoint-sqlite>=2.0.3",
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_escalation.py
RENAMED
|
@@ -162,7 +162,7 @@ class Escalation:
|
|
|
162
162
|
return current
|
|
163
163
|
|
|
164
164
|
def extract_response_value(self, action_data: Dict[str, Any]) -> Any:
|
|
165
|
-
if not self.
|
|
165
|
+
if not self._config:
|
|
166
166
|
return ""
|
|
167
167
|
|
|
168
168
|
response_template = self._config.get("response")
|
|
@@ -208,7 +208,7 @@ class Escalation:
|
|
|
208
208
|
|
|
209
209
|
return extracted_value
|
|
210
210
|
|
|
211
|
-
return
|
|
211
|
+
return action_data
|
|
212
212
|
|
|
213
213
|
async def create(self, value: Any) -> Optional[Action]:
|
|
214
214
|
"""
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_input.py
RENAMED
|
@@ -65,7 +65,7 @@ class LangGraphInputProcessor:
|
|
|
65
65
|
logger.debug(f"Action: {action}")
|
|
66
66
|
if action.data is None:
|
|
67
67
|
return Command(resume={})
|
|
68
|
-
if self.escalation:
|
|
68
|
+
if self.escalation and self.escalation.enabled:
|
|
69
69
|
extracted_value = self.escalation.extract_response_value(action.data)
|
|
70
70
|
return Command(resume=extracted_value)
|
|
71
71
|
return Command(resume=action.data)
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_output.py
RENAMED
|
@@ -15,7 +15,7 @@ from uipath_sdk._cli._runtime._contracts import (
|
|
|
15
15
|
UiPathRuntimeResult,
|
|
16
16
|
UiPathRuntimeStatus,
|
|
17
17
|
)
|
|
18
|
-
from uipath_sdk._models import InvokeProcess
|
|
18
|
+
from uipath_sdk._models import CreateAction, InvokeProcess, WaitAction, WaitJob
|
|
19
19
|
from uipath_sdk._models.actions import Action
|
|
20
20
|
|
|
21
21
|
from ._context import LangGraphRuntimeContext
|
|
@@ -34,10 +34,14 @@ class InterruptInfo:
|
|
|
34
34
|
@property
|
|
35
35
|
def type(self) -> Optional[UiPathResumeTriggerType]:
|
|
36
36
|
"""Returns the type of the interrupt value."""
|
|
37
|
-
if isinstance(self.value,
|
|
37
|
+
if isinstance(self.value, CreateAction):
|
|
38
|
+
return UiPathResumeTriggerType.ACTION
|
|
39
|
+
if isinstance(self.value, WaitAction):
|
|
38
40
|
return UiPathResumeTriggerType.ACTION
|
|
39
41
|
if isinstance(self.value, InvokeProcess):
|
|
40
42
|
return UiPathResumeTriggerType.JOB
|
|
43
|
+
if isinstance(self.value, WaitJob):
|
|
44
|
+
return UiPathResumeTriggerType.JOB
|
|
41
45
|
return None
|
|
42
46
|
|
|
43
47
|
@property
|
|
@@ -218,33 +222,62 @@ class LangGraphOutputProcessor:
|
|
|
218
222
|
|
|
219
223
|
try:
|
|
220
224
|
default_escalation = Escalation()
|
|
221
|
-
|
|
222
|
-
|
|
225
|
+
if default_escalation.enabled and isinstance(
|
|
226
|
+
self.interrupt_value, str
|
|
227
|
+
):
|
|
223
228
|
action = await default_escalation.create(self.interrupt_value)
|
|
224
229
|
if action:
|
|
225
230
|
self._resume_trigger = UiPathResumeTrigger(
|
|
226
231
|
trigger_type=UiPathResumeTriggerType.ACTION,
|
|
227
232
|
item_key=action.key,
|
|
228
233
|
)
|
|
229
|
-
|
|
230
|
-
if (
|
|
231
|
-
isinstance(self.interrupt_info, InterruptInfo)
|
|
232
|
-
and self.interrupt_info.type is UiPathResumeTriggerType.JOB
|
|
233
|
-
):
|
|
234
|
-
if not isinstance(self.interrupt_value, InvokeProcess):
|
|
235
|
-
raise Exception(
|
|
236
|
-
"Expected 'InvokeProcess' as interrupt value type"
|
|
237
|
-
)
|
|
238
|
-
|
|
234
|
+
return
|
|
235
|
+
if isinstance(self.interrupt_info, InterruptInfo):
|
|
239
236
|
uipath_sdk = UiPathSDK()
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
237
|
+
if self.interrupt_info.type is UiPathResumeTriggerType.JOB:
|
|
238
|
+
if isinstance(self.interrupt_value, InvokeProcess):
|
|
239
|
+
job = await uipath_sdk.processes.invoke_async(
|
|
240
|
+
name=self.interrupt_value.name,
|
|
241
|
+
input_arguments=self.interrupt_value.input_arguments,
|
|
242
|
+
)
|
|
243
|
+
if job:
|
|
244
|
+
self._resume_trigger = UiPathResumeTrigger(
|
|
245
|
+
trigger_type=UiPathResumeTriggerType.JOB,
|
|
246
|
+
item_key=job.Key,
|
|
247
|
+
)
|
|
248
|
+
elif isinstance(self.interrupt_value, WaitJob):
|
|
249
|
+
self._resume_trigger = UiPathResumeTrigger(
|
|
250
|
+
triggerType=UiPathResumeTriggerType.JOB,
|
|
251
|
+
itemKey=self.interrupt_value.job.Key,
|
|
252
|
+
)
|
|
253
|
+
elif self.interrupt_info.type is UiPathResumeTriggerType.ACTION:
|
|
254
|
+
if isinstance(self.interrupt_value, CreateAction):
|
|
255
|
+
action = uipath_sdk.actions.create(
|
|
256
|
+
title=self.interrupt_value.title,
|
|
257
|
+
app_name=self.interrupt_value.name
|
|
258
|
+
if self.interrupt_value.name
|
|
259
|
+
else "",
|
|
260
|
+
app_key=self.interrupt_value.key
|
|
261
|
+
if self.interrupt_value.key
|
|
262
|
+
else "",
|
|
263
|
+
app_version=self.interrupt_value.app_version
|
|
264
|
+
if self.interrupt_value.app_version
|
|
265
|
+
else 1,
|
|
266
|
+
data=self.interrupt_value.data,
|
|
267
|
+
)
|
|
268
|
+
if action:
|
|
269
|
+
self._resume_trigger = UiPathResumeTrigger(
|
|
270
|
+
trigger_type=UiPathResumeTriggerType.ACTION,
|
|
271
|
+
item_key=action.key,
|
|
272
|
+
)
|
|
273
|
+
elif isinstance(self.interrupt_value, WaitAction):
|
|
274
|
+
self._resume_trigger = UiPathResumeTrigger(
|
|
275
|
+
triggerType=UiPathResumeTriggerType.ACTION,
|
|
276
|
+
itemKey=self.interrupt_value.action.key,
|
|
277
|
+
)
|
|
278
|
+
else:
|
|
279
|
+
raise Exception(
|
|
280
|
+
f"Unknown interrupt value type {type(self.interrupt_value)}"
|
|
248
281
|
)
|
|
249
282
|
|
|
250
283
|
except Exception as e:
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/tracers/AsyncUiPathTracer.py
RENAMED
|
@@ -13,13 +13,15 @@ from langchain_core.tracers.base import AsyncBaseTracer
|
|
|
13
13
|
from langchain_core.tracers.schemas import Run
|
|
14
14
|
from pydantic import PydanticDeprecationWarning
|
|
15
15
|
|
|
16
|
+
from ._utils import _simple_serialize_defaults
|
|
17
|
+
|
|
16
18
|
logger = logging.getLogger(__name__)
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
class Status:
|
|
20
22
|
SUCCESS = 1
|
|
21
23
|
ERROR = 2
|
|
22
|
-
INTERRUPTED =
|
|
24
|
+
INTERRUPTED = 3
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
class AsyncUiPathTracer(AsyncBaseTracer):
|
|
@@ -235,7 +237,7 @@ class AsyncUiPathTracer(AsyncBaseTracer):
|
|
|
235
237
|
|
|
236
238
|
def _safe_json_dump(self, obj) -> str:
|
|
237
239
|
try:
|
|
238
|
-
json_str = json.dumps(obj, default=
|
|
240
|
+
json_str = json.dumps(obj, default=_simple_serialize_defaults)
|
|
239
241
|
return json_str
|
|
240
242
|
except Exception as e:
|
|
241
243
|
logger.warning(e)
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/tracers/UiPathTracer.py
RENAMED
|
@@ -11,6 +11,8 @@ from langchain_core.tracers.base import BaseTracer
|
|
|
11
11
|
from langchain_core.tracers.schemas import Run
|
|
12
12
|
from pydantic import PydanticDeprecationWarning
|
|
13
13
|
|
|
14
|
+
from ._utils import _simple_serialize_defaults
|
|
15
|
+
|
|
14
16
|
logger = logging.getLogger(__name__)
|
|
15
17
|
|
|
16
18
|
|
|
@@ -142,7 +144,7 @@ class UiPathTracer(BaseTracer):
|
|
|
142
144
|
|
|
143
145
|
def _safe_json_dump(self, obj) -> str:
|
|
144
146
|
try:
|
|
145
|
-
json_str = json.dumps(obj, default=
|
|
147
|
+
json_str = json.dumps(obj, default=_simple_serialize_defaults)
|
|
146
148
|
return json_str
|
|
147
149
|
except Exception as e:
|
|
148
150
|
logger.warning(e)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from zoneinfo import ZoneInfo
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def _simple_serialize_defaults(obj):
|
|
6
|
+
if hasattr(obj, "model_dump"):
|
|
7
|
+
return obj.model_dump(exclude_none=True, mode="json")
|
|
8
|
+
if hasattr(obj, "dict"):
|
|
9
|
+
return obj.dict()
|
|
10
|
+
if hasattr(obj, "to_dict"):
|
|
11
|
+
return obj.to_dict()
|
|
12
|
+
|
|
13
|
+
if isinstance(obj, (set, tuple)):
|
|
14
|
+
if hasattr(obj, "_asdict") and callable(obj._asdict):
|
|
15
|
+
return obj._asdict()
|
|
16
|
+
return list(obj)
|
|
17
|
+
|
|
18
|
+
if isinstance(obj, datetime.datetime):
|
|
19
|
+
return obj.isoformat()
|
|
20
|
+
|
|
21
|
+
if isinstance(obj, (datetime.timezone, ZoneInfo)):
|
|
22
|
+
return obj.tzname(None)
|
|
23
|
+
|
|
24
|
+
return str(obj)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_context.py
RENAMED
|
File without changes
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_exception.py
RENAMED
|
File without changes
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_cli/_runtime/_runtime.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/_request_mixin.py
RENAMED
|
File without changes
|
|
File without changes
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/_utils/_sleep_policy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/chat/utils/_chat_types.py
RENAMED
|
File without changes
|
|
File without changes
|
{uipath_langchain-0.0.76 → uipath_langchain-0.0.78}/uipath_langchain/embeddings/embeddings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|