Skip to content

Commit cc959ee

Browse files
authored
Factory fixes (#43)
1 parent 6dbaeef commit cc959ee

6 files changed

Lines changed: 31 additions & 36 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to `uipath_llm_client` (core package) will be documented in this file.
44

5+
## [1.5.2] - 2026-03-18
6+
7+
### Fix
8+
- Factory function fix
9+
510
## [1.5.1] - 2026-03-17
611

712
### Fix

packages/uipath_langchain_client/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to `uipath_langchain_client` will be documented in this file.
44

5+
## [1.5.2] - 2026-03-18
6+
7+
### Fix
8+
- Factory function fix
9+
510
## [1.5.1] - 2026-03-17
611

712
### Fixes

packages/uipath_langchain_client/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ readme = "README.md"
66
requires-python = ">=3.11"
77
dependencies = [
88
"langchain>=1.2.12",
9-
"uipath-llm-client>=1.5.1",
9+
"uipath-llm-client>=1.5.2",
1010
]
1111

1212
[project.optional-dependencies]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__title__ = "UiPath LangChain Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services via LangChain."
3-
__version__ = "1.5.1"
3+
__version__ = "1.5.2"

packages/uipath_langchain_client/src/uipath_langchain_client/factory.py

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def get_chat_model(
121121
vendor_type=vendor_type,
122122
)
123123
is_uipath_owned = model_info.get("modelSubscriptionType") == "UiPathOwned"
124+
model_family = model_info.get("modelFamily", "").lower()
124125
if not is_uipath_owned:
125126
client_settings.validate_byo_model(model_info)
126127

@@ -165,47 +166,31 @@ def get_chat_model(
165166
**model_kwargs,
166167
)
167168
case VendorType.VERTEXAI:
168-
if is_uipath_owned:
169-
if "claude" in model_name:
170-
from uipath_langchain_client.clients.anthropic.chat_models import (
171-
UiPathChatAnthropic,
172-
)
173-
174-
return UiPathChatAnthropic(
175-
model=model_name,
176-
settings=client_settings,
177-
vendor_type=discovered_vendor,
178-
byo_connection_id=byo_connection_id,
179-
**model_kwargs,
180-
)
181-
elif "gemini" in model_name:
182-
from uipath_langchain_client.clients.google.chat_models import (
183-
UiPathChatGoogleGenerativeAI,
184-
)
185-
186-
return UiPathChatGoogleGenerativeAI(
187-
model=model_name,
188-
settings=client_settings,
189-
byo_connection_id=byo_connection_id,
190-
**model_kwargs,
191-
)
192-
else:
193-
raise ValueError(
194-
f"We don't have a client that currently supports this model: {model_name} on vendor: {discovered_vendor}"
195-
)
196-
else:
197-
from uipath_langchain_client.clients.google.chat_models import (
198-
UiPathChatGoogleGenerativeAI,
169+
if model_family == "anthropicclaude":
170+
from uipath_langchain_client.clients.anthropic.chat_models import (
171+
UiPathChatAnthropic,
199172
)
200173

201-
return UiPathChatGoogleGenerativeAI(
174+
return UiPathChatAnthropic(
202175
model=model_name,
203176
settings=client_settings,
177+
vendor_type=discovered_vendor,
204178
byo_connection_id=byo_connection_id,
205179
**model_kwargs,
206180
)
181+
182+
from uipath_langchain_client.clients.google.chat_models import (
183+
UiPathChatGoogleGenerativeAI,
184+
)
185+
186+
return UiPathChatGoogleGenerativeAI(
187+
model=model_name,
188+
settings=client_settings,
189+
byo_connection_id=byo_connection_id,
190+
**model_kwargs,
191+
)
207192
case VendorType.AWSBEDROCK:
208-
if "claude" in model_name:
193+
if model_family == "anthropicclaude" and api_flavor is None:
209194
from uipath_langchain_client.clients.bedrock.chat_models import (
210195
UiPathChatAnthropicBedrock,
211196
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__title__ = "UiPath LLM Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services."
3-
__version__ = "1.5.1"
3+
__version__ = "1.5.2"

0 commit comments

Comments
 (0)