uipath-langchain 0.0.76__tar.gz → 0.0.77__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.

Potentially problematic release.


This version of uipath-langchain might be problematic. Click here for more details.

Files changed (34) hide show
  1. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/PKG-INFO +2 -2
  2. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/pyproject.toml +2 -2
  3. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/_runtime/_escalation.py +2 -2
  4. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/_runtime/_input.py +1 -1
  5. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/_runtime/_output.py +55 -22
  6. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/.gitignore +0 -0
  7. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/README.md +0 -0
  8. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/__init__.py +0 -0
  9. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/__init__.py +0 -0
  10. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/_runtime/_context.py +0 -0
  11. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/_runtime/_exception.py +0 -0
  12. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/_runtime/_runtime.py +0 -0
  13. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/_utils/_graph.py +0 -0
  14. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/cli_init.py +0 -0
  15. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_cli/cli_run.py +0 -0
  16. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_utils/__init__.py +0 -0
  17. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_utils/_request_mixin.py +0 -0
  18. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_utils/_settings.py +0 -0
  19. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_utils/_sleep_policy.py +0 -0
  20. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_utils/tests/cached_embeddings/text-embedding-3-large5034ec3c-85c9-54b8-ac89-5e0cbcf99e3b +0 -0
  21. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_utils/tests/cached_embeddings/text-embedding-3-largec48857ed-1302-5954-9e24-69fa9b45e457 +0 -0
  22. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/_utils/tests/tests_uipath_cache.db +0 -0
  23. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/chat/__init__.py +0 -0
  24. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/chat/models.py +0 -0
  25. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/chat/utils/__init__.py +0 -0
  26. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/chat/utils/_chat_types.py +0 -0
  27. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/embeddings/__init__.py +0 -0
  28. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/embeddings/embeddings.py +0 -0
  29. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/middlewares.py +0 -0
  30. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/retrievers/__init__.py +0 -0
  31. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/retrievers/context_grounding_retriever.py +0 -0
  32. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/tracers/AsyncUiPathTracer.py +0 -0
  33. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/uipath_langchain/tracers/UiPathTracer.py +0 -0
  34. {uipath_langchain-0.0.76 → uipath_langchain-0.0.77}/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.76
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.101
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.76"
3
+ version = "0.0.77"
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.101",
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",
@@ -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.enabled or not self._config:
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, Action):
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
- if default_escalation.enabled:
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
- job = await uipath_sdk.processes.invoke_async(
241
- name=self.interrupt_value.name,
242
- input_arguments=self.interrupt_value.input_arguments,
243
- )
244
- if job:
245
- self._resume_trigger = UiPathResumeTrigger(
246
- trigger_type=UiPathResumeTriggerType.JOB,
247
- item_key=job.Key,
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: