|
| 1 | +# UiPath chat models |
| 2 | + |
| 3 | +UiPath provides two chat models `UiPathAzureChatOpenAI` and `UiPathNormalizedChatModel`. 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 `AI Units` on your account. |
| 4 | + |
| 5 | +## UiPathAzureChatOpenAI |
| 6 | + |
| 7 | +`UiPathAzureChatOpenAI` can be used as a drop in replacement for `ChatOpenAI` or `AzureChatOpenAI`. |
| 8 | + |
| 9 | +### Example usage |
| 10 | + |
| 11 | +Here is a code that is using `ChatOpenAI` |
| 12 | +```python |
| 13 | +from langchain_openai import ChatOpenAI |
| 14 | + |
| 15 | +llm = ChatOpenAI( |
| 16 | + model="gpt-4o", |
| 17 | + temperature=0, |
| 18 | + max_tokens=None, |
| 19 | + timeout=None, |
| 20 | + max_retries=2, |
| 21 | + # api_key="...", # if you prefer to pass api key in directly instaed of using env vars |
| 22 | + # base_url="...", |
| 23 | + # organization="...", |
| 24 | + # other params... |
| 25 | +) |
| 26 | +``` |
| 27 | + |
| 28 | +You can simply change `ChatOpenAi` with `UiPathAzureChatOpenAI`, you don't have to provide an `OPEN_AI_TOKEN` |
| 29 | + |
| 30 | + |
| 31 | +```python |
| 32 | +from uipath_langchain.chat.models import UiPathAzureChatOpenAI |
| 33 | + |
| 34 | +llm = UiPathAzureChatOpenAI( |
| 35 | + model="gpt-4o", |
| 36 | + temperature=0, |
| 37 | + max_tokens=None, |
| 38 | + timeout=None, |
| 39 | + max_retries=2, |
| 40 | + # other params... |
| 41 | +) |
| 42 | +``` |
| 43 | + |
| 44 | +Currently the following models can be used with `UiPathAzureChatOpenAI` (this list can be updated in the future): |
| 45 | +- `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`, `o3-mini-2025-01-31` |
| 46 | + |
| 47 | + |
| 48 | +## UiPathNormalizedChatModel |
| 49 | + |
| 50 | +`UiPathNormalizedChatModel` is a more versatile clas that can suport models from diferent vendors including OpenAI. |
| 51 | + |
| 52 | +### Example usage |
| 53 | + |
| 54 | +Given the following code: |
| 55 | + |
| 56 | +```python |
| 57 | +from langchain_anthropic import ChatAnthropic |
| 58 | + |
| 59 | +llm = ChatAnthropic( |
| 60 | + model="claude-3-5-sonnet-20240620", |
| 61 | + temperature=0, |
| 62 | + max_tokens=1024, |
| 63 | + timeout=None, |
| 64 | + max_retries=2, |
| 65 | + # other params... |
| 66 | +) |
| 67 | +``` |
| 68 | + |
| 69 | +You can replace it with `UiPathNormalizedChatModel` like so: |
| 70 | + |
| 71 | +```python |
| 72 | +from uipath_langchain.chat.models import UiPathNormalizedChatModel |
| 73 | + |
| 74 | +llm = UiPathNormalizedChatModel( |
| 75 | + model="anthropic.claude-3-opus-20240229-v1:0", |
| 76 | + temperature=0, |
| 77 | + max_tokens=1024, |
| 78 | + timeout=None, |
| 79 | + max_retries=2, |
| 80 | + # other params... |
| 81 | +) |
| 82 | +``` |
| 83 | + |
| 84 | +Currently the following models can be used with `UiPathAzureChatOpenAI` (this list can be updated in the future): |
| 85 | +- `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` |
| 86 | + |
| 87 | +### Note |
| 88 | + |
| 89 | +Please note that that you may get errors related to data residency, as some models are not available on all regions. |
| 90 | + |
| 91 | +Example: `[Enforced Region] No model configuration found for product uipath-python-sdk in EU using model anthropic.claude-3-opus-20240229-v1:0`. |
0 commit comments