Skip to content

Commit fc62500

Browse files
ionmincuclaude
andcommitted
fix: promote provider-specific chat models in docs and new template
Replace UiPathChat references with UiPathChatAnthropicBedrock, UiPathChatBedrockConverse, UiPathAzureChatOpenAI, and UiPathChatVertex. Drop hardcoded model lists in favour of `uipath list-models`. Update the `uipath new` template to use UiPathChatAnthropicBedrock by default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 10e95ac commit fc62500

6 files changed

Lines changed: 103 additions & 41 deletions

File tree

docs/chat_models.md

Lines changed: 82 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
# Chat Models
22

3-
UiPath provides two chat models `UiPathAzureChatOpenAI` and `UiPathChat`. These are compatible with LangGraph as drop in replacements. You do not need to add tokens from OpenAI or Anthropic, usage of these chat models will consume `Agent Units` on your account.
3+
UiPath provides chat model classes compatible with LangChain and LangGraph as drop-in replacements. You do not need provider API keys — usage consumes Agent Units on your account.
44

5-
## UiPathAzureChatOpenAI
5+
To see the models available for your account, run:
66

7-
`UiPathAzureChatOpenAI` can be used as a drop in replacement for `ChatOpenAI` or `AzureChatOpenAI`.
7+
```bash
8+
uipath list-models
9+
```
10+
11+
/// warning
12+
`UiPathChat` and `UiPathAzureChatOpenAI` are deprecated and will be phased out in a future release. `UiPathAzureChatOpenAI` has been renamed to `UiPathChatOpenAI` (same class, new name). Migrate existing code to one of the provider-specific classes below.
13+
///
14+
15+
## UiPathChatOpenAI
816

9-
### Example usage
17+
Drop-in replacement for `ChatOpenAI` or `AzureChatOpenAI`. This is the new name for `UiPathAzureChatOpenAI`.
1018

11-
Here is a code that is using `ChatOpenAI`
19+
Original code using `ChatOpenAI`:
1220

1321
```python
1422
from langchain_openai import ChatOpenAI
@@ -26,13 +34,13 @@ llm = ChatOpenAI(
2634
)
2735
```
2836

29-
You can simply change `ChatOpenAi` with `UiPathAzureChatOpenAI`, you don't have to provide an OpenAI token.
37+
Swap `ChatOpenAI` for `UiPathChatOpenAI` — no OpenAI token needed:
3038

3139
```python
32-
from uipath_langchain.chat.models import UiPathAzureChatOpenAI
40+
from uipath_langchain.chat import UiPathChatOpenAI
3341

34-
llm = UiPathAzureChatOpenAI(
35-
model="gpt-4.1-mini-2025-04-14",
42+
llm = UiPathChatOpenAI(
43+
model="<model>",
3644
temperature=0,
3745
max_tokens=4000,
3846
timeout=30,
@@ -41,17 +49,11 @@ llm = UiPathAzureChatOpenAI(
4149
)
4250
```
4351

44-
Currently, the following models can be used with `UiPathAzureChatOpenAI` (this list can be updated in the future):
45-
46-
- `gpt-4`, `gpt-4-1106-Preview`, `gpt-4-32k`, `gpt-4-turbo-2024-04-09`, `gpt-4-vision-preview`, `gpt-4o-2024-05-13`, `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4.1-mini-2025-04-14`, `o3-mini-2025-01-31`
52+
## UiPathChatAnthropicBedrock
4753

48-
## UiPathChat
54+
Drop-in replacement for `ChatAnthropic` (or `ChatBedrock` when using Anthropic models).
4955

50-
`UiPathChat` is a more versatile class that can suport models from diferent vendors including OpenAI.
51-
52-
### Example usage
53-
54-
Given the following code:
56+
Original code using `ChatAnthropic`:
5557

5658
```python
5759
from langchain_anthropic import ChatAnthropic
@@ -66,13 +68,13 @@ llm = ChatAnthropic(
6668
)
6769
```
6870

69-
You can replace it with `UiPathChat` like so:
71+
Swap for `UiPathChatAnthropicBedrock`:
7072

7173
```python
72-
from uipath_langchain.chat.models import UiPathChat
74+
from uipath_langchain.chat import UiPathChatAnthropicBedrock
7375

74-
llm = UiPathChat(
75-
model="anthropic.claude-3-opus-20240229-v1:0",
76+
llm = UiPathChatAnthropicBedrock(
77+
model_id="<model>",
7678
temperature=0,
7779
max_tokens=1024,
7880
timeout=None,
@@ -81,13 +83,66 @@ llm = UiPathChat(
8183
)
8284
```
8385

84-
Currently the following models can be used with `UiPathChat` (this list can be updated in the future):
86+
## UiPathChatBedrockConverse
8587

86-
- `anthropic.claude-3-5-sonnet-20240620-v1:0`, `anthropic.claude-3-5-sonnet-20241022-v2:0`, `anthropic.claude-3-7-sonnet-20250219-v1:0`, `anthropic.claude-3-haiku-20240307-v1:0`, `gemini-1.5-pro-001`, `gemini-2.0-flash-001`, `gpt-4o-2024-05-13`, `gpt-4o-2024-08-06`, `gpt-4o-2024-11-20`, `gpt-4o-mini-2024-07-18`, `o3-mini-2025-01-31`
88+
Drop-in replacement for `ChatBedrockConverse` from `langchain_aws`. Supports models from multiple providers via the AWS Bedrock Converse API.
8789

88-
/// warning
89-
Please note that you may get errors related to data residency, as some models are not available on all regions.
90+
Original code using `ChatBedrockConverse`:
91+
92+
```python
93+
from langchain_aws import ChatBedrockConverse
94+
95+
llm = ChatBedrockConverse(
96+
model="anthropic.claude-3-5-sonnet-20240620-v1:0",
97+
temperature=0,
98+
max_tokens=1024,
99+
# other params...
100+
)
101+
```
102+
103+
Swap for `UiPathChatBedrockConverse`:
104+
105+
```python
106+
from uipath_langchain.chat import UiPathChatBedrockConverse
107+
108+
llm = UiPathChatBedrockConverse(
109+
model="<model>",
110+
temperature=0,
111+
max_tokens=1024,
112+
# other params...
113+
)
114+
```
115+
116+
## UiPathChatVertex
117+
118+
Drop-in replacement for `ChatGoogleGenerativeAI` or `ChatVertexAI`.
119+
120+
Original code using `ChatGoogleGenerativeAI`:
90121

91-
Example: `[Enforced Region] No model configuration found for product uipath-python-sdk in EU using model anthropic.claude-3-opus-20240229-v1:0`.
122+
```python
123+
from langchain_google_genai import ChatGoogleGenerativeAI
92124

125+
llm = ChatGoogleGenerativeAI(
126+
model="gemini-2.0-flash-001",
127+
temperature=0,
128+
max_tokens=1024,
129+
# other params...
130+
)
131+
```
132+
133+
Swap for `UiPathChatVertex`:
134+
135+
```python
136+
from uipath_langchain.chat import UiPathChatVertex
137+
138+
llm = UiPathChatVertex(
139+
model="<model>",
140+
temperature=0,
141+
max_tokens=1024,
142+
# other params...
143+
)
144+
```
145+
146+
/// warning
147+
Some models may not be available in all regions due to data residency restrictions. Use `uipath list-models` to see which models are available in your region.
93148
///

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies = [
2323
"langchain-mcp-adapters==0.2.1",
2424
"pillow>=12.1.1",
2525
"a2a-sdk>=0.2.0,<1.0.0",
26-
"uipath-langchain-client[openai]>=1.10.0,<1.11.0",
26+
"uipath-langchain-client[openai,bedrock]>=1.10.0,<1.11.0",
2727
]
2828

2929
classifiers = [

src/uipath_langchain/_cli/_templates/main.py.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from langchain_core.messages import HumanMessage, SystemMessage
22
from langgraph.graph import START, StateGraph, END
3-
from uipath_langchain.chat import UiPathChat
3+
from uipath_langchain.chat import UiPathChatAnthropicBedrock
44
from pydantic import BaseModel
55

6-
llm = UiPathChat(model="gpt-4o-mini-2024-07-18")
6+
llm = UiPathChatAnthropicBedrock(model="anthropic.claude-haiku-4-5-20251001-v1:0")
77

88

99
class GraphState(BaseModel):

src/uipath_langchain/_resources/REQUIRED_STRUCTURE.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,22 @@ class Output(BaseModel):
2727

2828
### Required LLM Initialization
2929

30-
Unless the user explicitly requests a different LLM provider, always use `UiPathChat`:
30+
Unless the user explicitly requests a different LLM provider, always use `UiPathChatAnthropicBedrock`:
3131

3232
```python
33-
from uipath_langchain.chat import UiPathChat
33+
from uipath_langchain.chat import UiPathChatAnthropicBedrock
3434

35-
llm = UiPathChat(model="gpt-4.1-mini-2025-04-14", temperature=0.7)
35+
llm = UiPathChatAnthropicBedrock(model="anthropic.claude-haiku-4-5-20251001-v1:0", temperature=0.7)
3636
```
3737

38-
**Alternative LLMs** (only use if explicitly requested):
38+
To list available models, run `uipath list-models`.
39+
40+
**Alternative UiPath chat models**:
41+
- `UiPathChatOpenAI` for OpenAI / Azure OpenAI models
42+
- `UiPathChatBedrockConverse` for the AWS Bedrock Converse API (multi-provider)
43+
- `UiPathChatVertex` for Google Vertex AI models
44+
45+
**Alternative LangChain LLMs** (only use if explicitly requested):
3946
- `ChatOpenAI` from `langchain_openai`
4047
- `ChatAnthropic` from `langchain_anthropic`
4148
- Other LangChain-compatible LLMs
@@ -47,7 +54,7 @@ Every agent should follow this basic structure:
4754
```python
4855
from langchain_core.messages import SystemMessage, HumanMessage
4956
from langgraph.graph import START, StateGraph, END
50-
from uipath_langchain.chat import UiPathChat
57+
from uipath_langchain.chat import UiPathChatAnthropicBedrock
5158
from pydantic import BaseModel
5259

5360
# 1. Define Input, State, and Output models
@@ -61,8 +68,8 @@ class State(BaseModel):
6168
class Output(BaseModel):
6269
result: str
6370

64-
# 2. Initialize UiPathChat LLM
65-
llm = UiPathChat(model="gpt-4.1-mini-2025-04-14", temperature=0.7)
71+
# 2. Initialize the LLM
72+
llm = UiPathChatAnthropicBedrock(model="anthropic.claude-haiku-4-5-20251001-v1:0", temperature=0.7)
6673

6774
# 3. Define agent nodes (async functions)
6875
async def process_node(state: State) -> State:

testcases/init-flow/expected_traces.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
}
1515
},
1616
{
17-
"name": "UiPathChat",
17+
"name": "UiPathChatAnthropicBedrock",
1818
"attributes": {
1919
"openinference.span.kind": "LLM",
20-
"llm.provider": "uipath",
20+
"llm.provider": "anthropic-bedrock",
2121
"llm.model_name": "*"
2222
}
2323
}

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)