uipath-langchain 0.0.75__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.

@@ -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:
@@ -18,12 +18,12 @@ from tenacity import (
18
18
  wait_exponential_jitter,
19
19
  )
20
20
 
21
- from uipath_langchain.utils._settings import (
21
+ from uipath_langchain._utils._settings import (
22
22
  UiPathClientFactorySettings,
23
23
  UiPathClientSettings,
24
24
  get_uipath_token_header,
25
25
  )
26
- from uipath_langchain.utils._sleep_policy import before_sleep_log
26
+ from uipath_langchain._utils._sleep_policy import before_sleep_log
27
27
 
28
28
 
29
29
  def get_from_uipath_url():
@@ -425,9 +425,14 @@ class UiPathRequestMixin(BaseModel):
425
425
  @property
426
426
  def url(self) -> str:
427
427
  if not self._url:
428
- self._url = (
429
- f"{self.base_url}/{self.org_id}/{self.tenant_id}/{self.endpoint}"
430
- )
428
+ env_uipath_url = os.getenv("UIPATH_URL")
429
+
430
+ if env_uipath_url:
431
+ self._url = f"{env_uipath_url.rstrip('/')}/{self.endpoint}"
432
+ else:
433
+ self._url = (
434
+ f"{self.base_url}/{self.org_id}/{self.tenant_id}/{self.endpoint}"
435
+ )
431
436
  return self._url
432
437
 
433
438
  @property
@@ -13,8 +13,8 @@ from langchain_core.runnables import Runnable
13
13
  from langchain_openai.chat_models import AzureChatOpenAI
14
14
  from pydantic import BaseModel
15
15
 
16
- from uipath_langchain.utils._request_mixin import UiPathRequestMixin
17
- from uipath_langchain.utils._settings import UiPathEndpoints
16
+ from uipath_langchain._utils._request_mixin import UiPathRequestMixin
17
+ from uipath_langchain._utils._settings import UiPathEndpoints
18
18
 
19
19
 
20
20
  class UiPathAzureChatOpenAI(UiPathRequestMixin, AzureChatOpenAI):
@@ -6,8 +6,8 @@ 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
8
 
9
- from uipath_langchain.utils._request_mixin import UiPathRequestMixin
10
- from uipath_langchain.utils._settings import UiPathEndpoints
9
+ 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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath-langchain
3
- Version: 0.0.75
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
@@ -4,31 +4,31 @@ 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=mjp_VrXZ2UFTNs14akkUE43OTd0Z_lnCGErwdX-knlU,8081
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=2oXHmq51dgdFaRIRYI34SrXXBT9Tjru-BU-TeUU5ejw,5363
10
- uipath_langchain/_cli/_runtime/_output.py,sha256=OT3ZTWUWGJbgQ4ZHeTlS5nups1Lva618wgURQBMFmqc,11029
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
+ uipath_langchain/_utils/__init__.py,sha256=-w-4TD9ZnJDCpj4VIPXhJciukrmDJJbmnOFnhAkAaEU,81
14
+ uipath_langchain/_utils/_request_mixin.py,sha256=t_1HWBxqEl-wsSk9ubmIM-8vs9BlNy4ZVBxtDxktn6U,18489
15
+ uipath_langchain/_utils/_settings.py,sha256=MhwEVj4gVRSar0RBf2w2hTjO-5Qm-HpCuufqN3gSWjA,3390
16
+ uipath_langchain/_utils/_sleep_policy.py,sha256=e9pHdjmcCj4CVoFM1jMyZFelH11YatsgWfpyrfXzKBQ,1251
17
+ uipath_langchain/_utils/tests/tests_uipath_cache.db,sha256=6xlNESkPeA3Z_pz_a5whJpTs_TkqCrOjAEY_ckf8sWo,130
18
+ uipath_langchain/_utils/tests/cached_embeddings/text-embedding-3-large5034ec3c-85c9-54b8-ac89-5e0cbcf99e3b,sha256=beivo43s6nwI_uANjhyflRQs86BMU0rU9LA31R5tL_c,130
19
+ uipath_langchain/_utils/tests/cached_embeddings/text-embedding-3-largec48857ed-1302-5954-9e24-69fa9b45e457,sha256=08XaRxbtpUV8CaD2NE4bVM__EldNqQ2PoNUE1a5GCsQ,130
13
20
  uipath_langchain/chat/__init__.py,sha256=hJCcfzHwKx2coTNzo4ggV3_4QVNrtbtIvxa03CubEYI,146
14
- uipath_langchain/chat/models.py,sha256=fXQlvv8ELImB1T3JRzMx3a9f1hbEEbuKGvDJRrTfnbg,10238
21
+ uipath_langchain/chat/models.py,sha256=0vt8N9lUQk8-6mhsm1dtCOJLDL4i7ukrg2TPGYJ4KR0,10240
15
22
  uipath_langchain/chat/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
23
  uipath_langchain/chat/utils/_chat_types.py,sha256=iTUh4gY8ML2yLzTQ7H4ZFXChA8RbPz7NgkJK4x7fSbs,1226
17
24
  uipath_langchain/embeddings/__init__.py,sha256=QICtYB58ZyqFfDQrEaO8lTEgAU5NuEKlR7iIrS0OBtc,156
18
- uipath_langchain/embeddings/embeddings.py,sha256=jeGKRn-n76_GZCHCZlihuEejRxv9F52gZD1Vo3dpEWI,4272
25
+ uipath_langchain/embeddings/embeddings.py,sha256=gntzTfwO1pHbgnXiPdfETJaaurvQWqxVUCH75VMah54,4274
19
26
  uipath_langchain/retrievers/__init__.py,sha256=rOn7PyyHgZ4pMnXWPkGqmuBmx8eGuo-Oyndo7Wm9IUU,108
20
27
  uipath_langchain/retrievers/context_grounding_retriever.py,sha256=iOR97_qNSxYtaMfRV1QsJhdvE3CVan3Uff72QC9Wkuo,1174
21
28
  uipath_langchain/tracers/AsyncUiPathTracer.py,sha256=k-cwv4_5JZZqYR3ng8EBVXiWAwRl6WJpndAiqAnqqPY,8498
22
29
  uipath_langchain/tracers/UiPathTracer.py,sha256=PPZKRREkA-GNk1naqtkeEBr9brEEwaO_X8Lb26AHQQM,5529
23
30
  uipath_langchain/tracers/__init__.py,sha256=wH-enSqPsMo70cTExRhavWooDFZ1Yfa36CKQdYUspXs,137
24
- uipath_langchain/utils/__init__.py,sha256=-w-4TD9ZnJDCpj4VIPXhJciukrmDJJbmnOFnhAkAaEU,81
25
- uipath_langchain/utils/_request_mixin.py,sha256=WFyTDyAthSci1DRwUwS21I3hLntD7HdVzYc0ZPoi3ys,18296
26
- uipath_langchain/utils/_settings.py,sha256=MhwEVj4gVRSar0RBf2w2hTjO-5Qm-HpCuufqN3gSWjA,3390
27
- uipath_langchain/utils/_sleep_policy.py,sha256=e9pHdjmcCj4CVoFM1jMyZFelH11YatsgWfpyrfXzKBQ,1251
28
- uipath_langchain/utils/tests/tests_uipath_cache.db,sha256=6xlNESkPeA3Z_pz_a5whJpTs_TkqCrOjAEY_ckf8sWo,130
29
- uipath_langchain/utils/tests/cached_embeddings/text-embedding-3-large5034ec3c-85c9-54b8-ac89-5e0cbcf99e3b,sha256=beivo43s6nwI_uANjhyflRQs86BMU0rU9LA31R5tL_c,130
30
- uipath_langchain/utils/tests/cached_embeddings/text-embedding-3-largec48857ed-1302-5954-9e24-69fa9b45e457,sha256=08XaRxbtpUV8CaD2NE4bVM__EldNqQ2PoNUE1a5GCsQ,130
31
- uipath_langchain-0.0.75.dist-info/METADATA,sha256=r5Qh3aSIaRB-0mQKTIpZuic1NAiNUDudW3jcvF_HYiQ,1182
32
- uipath_langchain-0.0.75.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
33
- uipath_langchain-0.0.75.dist-info/entry_points.txt,sha256=vB4ttaYft0qEsoCQ8qAoQGLmOYysY42x8p_rM-c_jF4,85
34
- uipath_langchain-0.0.75.dist-info/RECORD,,
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
File without changes