uipath-langchain 0.0.76__py3-none-any.whl → 0.0.77__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/_cli/_runtime/_escalation.py +2 -2
- uipath_langchain/_cli/_runtime/_input.py +1 -1
- uipath_langchain/_cli/_runtime/_output.py +55 -22
- {uipath_langchain-0.0.76.dist-info → uipath_langchain-0.0.77.dist-info}/METADATA +2 -2
- {uipath_langchain-0.0.76.dist-info → uipath_langchain-0.0.77.dist-info}/RECORD +7 -7
- {uipath_langchain-0.0.76.dist-info → uipath_langchain-0.0.77.dist-info}/WHEEL +0 -0
- {uipath_langchain-0.0.76.dist-info → uipath_langchain-0.0.77.dist-info}/entry_points.txt +0 -0
|
@@ -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
|
"""
|
|
@@ -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)
|
|
@@ -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:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath-langchain
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.77
|
|
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
|
|
@@ -4,10 +4,10 @@ uipath_langchain/_cli/__init__.py,sha256=juqd9PbXs4yg45zMJ7BHAOPQjb7sgEbWE9InBtG
|
|
|
4
4
|
uipath_langchain/_cli/cli_init.py,sha256=v_lT4r8sBjujqLuBDZDsTWk0RHkXD3-_XZhdnSznvuU,6391
|
|
5
5
|
uipath_langchain/_cli/cli_run.py,sha256=JduZXJMg7arD9Y6Nr-Sw7SxbaA68xR7f4NNo-raRB1A,2923
|
|
6
6
|
uipath_langchain/_cli/_runtime/_context.py,sha256=tp95ilAu2PwtjfzUNcM0nxvNdtzoWdcyBMqOnTJEIzw,811
|
|
7
|
-
uipath_langchain/_cli/_runtime/_escalation.py,sha256=
|
|
7
|
+
uipath_langchain/_cli/_runtime/_escalation.py,sha256=Ii8FTRODQFuzZNRFU8F52QxDNWKuiw5xkNQaCEN2Clk,8070
|
|
8
8
|
uipath_langchain/_cli/_runtime/_exception.py,sha256=0KKJh7wR54HapGW4BNQvEsGUWumvTuF_t0k3huVmn-g,550
|
|
9
|
-
uipath_langchain/_cli/_runtime/_input.py,sha256=
|
|
10
|
-
uipath_langchain/_cli/_runtime/_output.py,sha256=
|
|
9
|
+
uipath_langchain/_cli/_runtime/_input.py,sha256=pZ_5F34UmadJ5vlvJ7ZfNxqif8AlkooVwRMh8GyY8FY,5391
|
|
10
|
+
uipath_langchain/_cli/_runtime/_output.py,sha256=ZessNR_Tx0wEtAFDmRI0L0mlZHd5sbpAhu-57h9YSrs,13392
|
|
11
11
|
uipath_langchain/_cli/_runtime/_runtime.py,sha256=PoPNVGaBfx6I--Cu1VXNYzozIaIfxv4iBSCKtKNnU0A,11015
|
|
12
12
|
uipath_langchain/_cli/_utils/_graph.py,sha256=WLBSJfPc3_C07SqJhePRe17JIc5wcBvEqLviMcNOdTA,6950
|
|
13
13
|
uipath_langchain/_utils/__init__.py,sha256=-w-4TD9ZnJDCpj4VIPXhJciukrmDJJbmnOFnhAkAaEU,81
|
|
@@ -28,7 +28,7 @@ uipath_langchain/retrievers/context_grounding_retriever.py,sha256=iOR97_qNSxYtaM
|
|
|
28
28
|
uipath_langchain/tracers/AsyncUiPathTracer.py,sha256=k-cwv4_5JZZqYR3ng8EBVXiWAwRl6WJpndAiqAnqqPY,8498
|
|
29
29
|
uipath_langchain/tracers/UiPathTracer.py,sha256=PPZKRREkA-GNk1naqtkeEBr9brEEwaO_X8Lb26AHQQM,5529
|
|
30
30
|
uipath_langchain/tracers/__init__.py,sha256=wH-enSqPsMo70cTExRhavWooDFZ1Yfa36CKQdYUspXs,137
|
|
31
|
-
uipath_langchain-0.0.
|
|
32
|
-
uipath_langchain-0.0.
|
|
33
|
-
uipath_langchain-0.0.
|
|
34
|
-
uipath_langchain-0.0.
|
|
31
|
+
uipath_langchain-0.0.77.dist-info/METADATA,sha256=tMDAHWP9RScv7ZVGi1TlT-46lBC4GrXSXDV78uJz8vw,1182
|
|
32
|
+
uipath_langchain-0.0.77.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
33
|
+
uipath_langchain-0.0.77.dist-info/entry_points.txt,sha256=vB4ttaYft0qEsoCQ8qAoQGLmOYysY42x8p_rM-c_jF4,85
|
|
34
|
+
uipath_langchain-0.0.77.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|