Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-langchain"
version = "0.0.122"
version = "0.0.123"
description = "UiPath Langchain"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10"
Expand Down
15 changes: 15 additions & 0 deletions src/uipath_langchain/_utils/_request_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
stop_after_attempt,
wait_exponential_jitter,
)
from uipath._cli._runtime._contracts import UiPathErrorCategory
from uipath._utils._ssl_context import get_httpx_client_kwargs

from uipath_langchain._cli._runtime._exception import LangGraphRuntimeError
from uipath_langchain._utils._settings import (
UiPathClientFactorySettings,
UiPathClientSettings,
Expand Down Expand Up @@ -348,6 +350,19 @@ def _make_status_error(
return openai.AuthenticationError(err_msg, response=response, body=data)

if response.status_code == 403:
# Check if this is a license-specific error
if isinstance(body, dict):
title = body.get("title", "").lower()
if title == "license not available":
raise LangGraphRuntimeError(
code="LICENSE_NOT_AVAILABLE",
title=body.get("title", "License Not Available"),
detail=body.get(
"detail", "License not available for this service"
),
category=UiPathErrorCategory.DEPLOYMENT,
)

return openai.PermissionDeniedError(err_msg, response=response, body=data)

if response.status_code == 404:
Expand Down
Loading