uipath-langchain 0.0.122__py3-none-any.whl → 0.0.124__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.

@@ -18,6 +18,7 @@ from uipath._cli._runtime._contracts import (
18
18
 
19
19
  from ..._utils import _instrument_traceable_attributes
20
20
  from ...tracers import AsyncUiPathTracer
21
+ from .._utils._graph import LangGraphConfig
21
22
  from ._context import LangGraphRuntimeContext
22
23
  from ._exception import LangGraphRuntimeError
23
24
  from ._input import LangGraphInputProcessor
@@ -190,12 +191,14 @@ class LangGraphRuntime(UiPathBaseRuntime):
190
191
  ) from e
191
192
 
192
193
  if self.context.langgraph_config is None:
193
- raise LangGraphRuntimeError(
194
- "CONFIG_MISSING",
195
- "Invalid configuration",
196
- "Failed to load configuration",
197
- UiPathErrorCategory.DEPLOYMENT,
198
- )
194
+ self.context.langgraph_config = LangGraphConfig()
195
+ if not self.context.langgraph_config.exists:
196
+ raise LangGraphRuntimeError(
197
+ "CONFIG_MISSING",
198
+ "Invalid configuration",
199
+ "Failed to load configuration",
200
+ UiPathErrorCategory.DEPLOYMENT,
201
+ )
199
202
 
200
203
  try:
201
204
  self.context.langgraph_config.load_config()
@@ -0,0 +1,41 @@
1
+ import asyncio
2
+ from typing import Optional
3
+
4
+ from openinference.instrumentation.langchain import (
5
+ LangChainInstrumentor,
6
+ get_current_span,
7
+ )
8
+ from uipath._cli._dev._terminal import UiPathDevTerminal
9
+ from uipath._cli._runtime._contracts import UiPathRuntimeFactory
10
+ from uipath._cli._utils._console import ConsoleLogger
11
+ from uipath._cli.middlewares import MiddlewareResult
12
+
13
+ from ._runtime._context import LangGraphRuntimeContext
14
+ from ._runtime._runtime import LangGraphRuntime
15
+
16
+ console = ConsoleLogger()
17
+
18
+
19
+ def langgraph_dev_middleware(interface: Optional[str]) -> MiddlewareResult:
20
+ """Middleware to launch the developer terminal"""
21
+
22
+ try:
23
+ if interface == "terminal":
24
+ runtime_factory = UiPathRuntimeFactory(
25
+ LangGraphRuntime, LangGraphRuntimeContext
26
+ )
27
+ runtime_factory.add_instrumentor(LangChainInstrumentor, get_current_span)
28
+ app = UiPathDevTerminal(runtime_factory)
29
+ asyncio.run(app.run_async())
30
+ else:
31
+ console.error(f"Unknown interface: {interface}")
32
+ except KeyboardInterrupt:
33
+ console.info("Debug session interrupted by user")
34
+ except Exception as e:
35
+ console.error(f"Error occurred: {e}")
36
+ return MiddlewareResult(
37
+ should_continue=False,
38
+ should_include_stacktrace=True,
39
+ )
40
+
41
+ return MiddlewareResult(should_continue=False)
@@ -17,8 +17,10 @@ from tenacity import (
17
17
  stop_after_attempt,
18
18
  wait_exponential_jitter,
19
19
  )
20
+ from uipath._cli._runtime._contracts import UiPathErrorCategory
20
21
  from uipath._utils._ssl_context import get_httpx_client_kwargs
21
22
 
23
+ from uipath_langchain._cli._runtime._exception import LangGraphRuntimeError
22
24
  from uipath_langchain._utils._settings import (
23
25
  UiPathClientFactorySettings,
24
26
  UiPathClientSettings,
@@ -348,6 +350,19 @@ class UiPathRequestMixin(BaseModel):
348
350
  return openai.AuthenticationError(err_msg, response=response, body=data)
349
351
 
350
352
  if response.status_code == 403:
353
+ # Check if this is a license-specific error
354
+ if isinstance(body, dict):
355
+ title = body.get("title", "").lower()
356
+ if title == "license not available":
357
+ raise LangGraphRuntimeError(
358
+ code="LICENSE_NOT_AVAILABLE",
359
+ title=body.get("title", "License Not Available"),
360
+ detail=body.get(
361
+ "detail", "License not available for this service"
362
+ ),
363
+ category=UiPathErrorCategory.DEPLOYMENT,
364
+ )
365
+
351
366
  return openai.PermissionDeniedError(err_msg, response=response, body=data)
352
367
 
353
368
  if response.status_code == 404:
@@ -1,5 +1,6 @@
1
1
  from uipath._cli.middlewares import Middlewares
2
2
 
3
+ from ._cli.cli_dev import langgraph_dev_middleware
3
4
  from ._cli.cli_init import langgraph_init_middleware
4
5
  from ._cli.cli_new import langgraph_new_middleware
5
6
  from ._cli.cli_run import langgraph_run_middleware
@@ -10,3 +11,4 @@ def register_middleware():
10
11
  Middlewares.register("init", langgraph_init_middleware)
11
12
  Middlewares.register("run", langgraph_run_middleware)
12
13
  Middlewares.register("new", langgraph_new_middleware)
14
+ Middlewares.register("dev", langgraph_dev_middleware)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath-langchain
3
- Version: 0.0.122
3
+ Version: 0.0.124
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
@@ -22,9 +22,10 @@ Requires-Dist: langchain>=0.3.4
22
22
  Requires-Dist: langgraph-checkpoint-sqlite>=2.0.3
23
23
  Requires-Dist: langgraph<0.7.0,>=0.5.0
24
24
  Requires-Dist: openai>=1.65.5
25
+ Requires-Dist: openinference-instrumentation-langchain>=0.1.50
25
26
  Requires-Dist: pydantic-settings>=2.6.0
26
27
  Requires-Dist: python-dotenv>=1.0.1
27
- Requires-Dist: uipath<2.2.0,>=2.1.10
28
+ Requires-Dist: uipath<2.2.0,>=2.1.30
28
29
  Provides-Extra: langchain
29
30
  Description-Content-Type: text/markdown
30
31
 
@@ -1,6 +1,7 @@
1
1
  uipath_langchain/__init__.py,sha256=VBrvQn7d3nuOdN7zEnV2_S-uhmkjgEIlXiFVeZxZakQ,80
2
- uipath_langchain/middlewares.py,sha256=tre7o9DFMgWk1DJiEEUmT6_wiP-PPkWtKmG0iOyvr9c,509
2
+ uipath_langchain/middlewares.py,sha256=EOWVTr52SFLEf5lzGAvcDN2qbtPsy4_EsFoXlV-cqdY,618
3
3
  uipath_langchain/_cli/__init__.py,sha256=juqd9PbXs4yg45zMJ7BHAOPQjb7sgEbWE9InBtGZhfo,24
4
+ uipath_langchain/_cli/cli_dev.py,sha256=VlI8qgCw-63I97tp_9lbXs-CVcNSjpd2sC13YNZAIuU,1401
4
5
  uipath_langchain/_cli/cli_init.py,sha256=xhxJ8tuMSrVUNHvltgyPpOrvgMA-wq9shHeYYwvHILs,8199
5
6
  uipath_langchain/_cli/cli_new.py,sha256=dL8-Rri6u67ZZdbb4nT38A5xD_Q3fVnG0UK9VSeKaqg,2563
6
7
  uipath_langchain/_cli/cli_run.py,sha256=Jr-nxzBaSPQoVrdV1nQBSDVFElFV3N0a0uNDDrdSc8I,3375
@@ -8,12 +9,12 @@ uipath_langchain/_cli/_runtime/_context.py,sha256=yyzYJDmk2fkH4T5gm4cLGRyXtjLESr
8
9
  uipath_langchain/_cli/_runtime/_exception.py,sha256=USKkLYkG-dzjX3fEiMMOHnVUpiXJs_xF0OQXCCOvbYM,546
9
10
  uipath_langchain/_cli/_runtime/_input.py,sha256=vZ8vfVxvPSaPWmIPghvNx1VRKzbalHsKUMBPiKDvJWM,5492
10
11
  uipath_langchain/_cli/_runtime/_output.py,sha256=yJOZPWv2FRUJWv1NRs9JmpB4QMTDXu8jrxoaKrfJvzw,9078
11
- uipath_langchain/_cli/_runtime/_runtime.py,sha256=XTlPaMuHyv-4DjQMoEh76D2Z18M3S5wm4tDP-UAiE5Y,14505
12
+ uipath_langchain/_cli/_runtime/_runtime.py,sha256=E4aEX4eTjK2XymdKYD1fXNz668S4U2CwEmfL7HSNxjo,14692
12
13
  uipath_langchain/_cli/_templates/langgraph.json.template,sha256=eeh391Gta_hoRgaNaZ58nW1LNvCVXA7hlAH6l7Veous,107
13
14
  uipath_langchain/_cli/_templates/main.py.template,sha256=nMJQIYPlRk90iANfNVpkJ2EQX20Dxsyq92-BucEz_UM,1189
14
15
  uipath_langchain/_cli/_utils/_graph.py,sha256=JPShHNl0UQvl4AdjLIqLpNt_JAjpWH9WWF22Gs47Xew,7445
15
16
  uipath_langchain/_utils/__init__.py,sha256=WoY66enCygRXTh6v5B1UrRcFCnQYuPJ8oqDkwomXzLc,194
16
- uipath_langchain/_utils/_request_mixin.py,sha256=Bf8l43T0uqwUsucBE_2C1aeB9b0bmf11-3SyKr6RNpA,18926
17
+ uipath_langchain/_utils/_request_mixin.py,sha256=Tr57358_dwb7SQ1OU75XjdFVWEIr05-QJifeJfHHZgc,19680
17
18
  uipath_langchain/_utils/_settings.py,sha256=2fExMQJ88YptfldmzMfZIpsx-m1gfMkeYGf5t6KIe0A,3084
18
19
  uipath_langchain/_utils/_sleep_policy.py,sha256=e9pHdjmcCj4CVoFM1jMyZFelH11YatsgWfpyrfXzKBQ,1251
19
20
  uipath_langchain/chat/__init__.py,sha256=WDcvy91ixvZ3Mq7Ae94g5CjyQwXovDBnEv1NlD5SXBE,116
@@ -29,8 +30,8 @@ uipath_langchain/tracers/_instrument_traceable.py,sha256=0e841zVzcPWjOGtmBx0GeHb
29
30
  uipath_langchain/tracers/_utils.py,sha256=JOT1tKMdvqjMDtj2WbmbOWMeMlTXBWavxWpogX7KlRA,1543
30
31
  uipath_langchain/vectorstores/__init__.py,sha256=w8qs1P548ud1aIcVA_QhBgf_jZDrRMK5Lono78yA8cs,114
31
32
  uipath_langchain/vectorstores/context_grounding_vectorstore.py,sha256=TncIXG-YsUlO0R5ZYzWsM-Dj1SVCZbzmo2LraVxXelc,9559
32
- uipath_langchain-0.0.122.dist-info/METADATA,sha256=7OfcSeeI163hwKCDAyMUDhFeL7ivuqZLY-wexZZB7KQ,4172
33
- uipath_langchain-0.0.122.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
- uipath_langchain-0.0.122.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
35
- uipath_langchain-0.0.122.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
36
- uipath_langchain-0.0.122.dist-info/RECORD,,
33
+ uipath_langchain-0.0.124.dist-info/METADATA,sha256=zIj8p28Nc1KOTVJ7wjJNCXbsyMAmbx995lA8GdAoeUs,4235
34
+ uipath_langchain-0.0.124.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
+ uipath_langchain-0.0.124.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
36
+ uipath_langchain-0.0.124.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
37
+ uipath_langchain-0.0.124.dist-info/RECORD,,