Skip to content

Commit 957b28a

Browse files
committed
fix: revert to main
1 parent d6471e5 commit 957b28a

13 files changed

Lines changed: 119 additions & 32 deletions

File tree

packages/uipath-llamaindex/.vscode/settings.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/uipath-llamaindex/docs/llms_and_embeddings.md

Lines changed: 96 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# LLMs and Embeddings
22

33
UiPath provides pre-configured LLM and embedding classes that handle authentication, routing, and configuration automatically, allowing you to focus on building your agents.
4-
You do not need to add tokens from OpenAI, usage of these models will consume `Agent Units` on your account.
4+
You do not need to add API keys from OpenAI, AWS, or Google, usage of these models will consume `Agent Units` on your account.
55

66
## UiPathOpenAI
77

@@ -49,10 +49,10 @@ print(response)
4949
from uipath_llamaindex.llms import UiPathOpenAI, OpenAIModel
5050

5151
# Use a specific model
52-
llm = UiPathOpenAI(model=OpenAIModel.GPT_4O_2024_11_20)
52+
llm = UiPathOpenAI(model=OpenAIModel.GPT_4_1_2025_04_14)
5353

5454
# Or use a model string directly
55-
llm = UiPathOpenAI(model="gpt-4o-2024-11-20")
55+
llm = UiPathOpenAI(model="gpt-4.1-2025-04-14")
5656
```
5757

5858
## UiPathOpenAIEmbedding
@@ -97,10 +97,100 @@ embeddings = embed_model.get_text_embedding_batch(texts)
9797
print(f"Number of embeddings: {len(embeddings)}")
9898
```
9999

100+
## UiPathChatBedrock and UiPathChatBedrockConverse
101+
102+
`UiPathChatBedrock` and `UiPathChatBedrockConverse` provide access to AWS Bedrock models through UiPath using the Invoke API and Converse API respectively.
103+
104+
### Installation
105+
106+
These classes require additional dependencies. Install them with:
107+
108+
```bash
109+
pip install uipath-llamaindex[bedrock]
110+
# or using uv:
111+
uv add 'uipath-llamaindex[bedrock]'
112+
```
113+
114+
### Example Usage
115+
116+
```python
117+
from uipath_llamaindex.llms.bedrock import UiPathChatBedrockConverse
118+
from uipath_llamaindex.llms import BedrockModel
119+
from llama_index.core.llms import ChatMessage
120+
121+
# Create an LLM instance with default settings
122+
llm = UiPathChatBedrockConverse()
123+
124+
# Or use a specific model
125+
llm = UiPathChatBedrockConverse(model=BedrockModel.anthropic_claude_sonnet_4_5)
126+
127+
# Create chat messages
128+
messages = [
129+
ChatMessage(role="user", content="Hello"),
130+
]
131+
132+
# Generate a response
133+
response = llm.chat(messages)
134+
print(response)
135+
```
136+
137+
Similarly, `UiPathChatBedrock` can be used with the Invoke API:
138+
139+
```python
140+
from uipath_llamaindex.llms.bedrock import UiPathChatBedrock
141+
from uipath_llamaindex.llms import BedrockModel
142+
143+
llm = UiPathChatBedrock(model=BedrockModel.anthropic_claude_sonnet_4)
144+
```
145+
146+
Currently, the following models can be used (this list can be updated in the future):
147+
148+
- `anthropic.claude-3-7-sonnet-20250219-v1:0`, `anthropic.claude-sonnet-4-20250514-v1:0`, `anthropic.claude-sonnet-4-5-20250929-v1:0`, `anthropic.claude-haiku-4-5-20251001-v1:0`
149+
150+
## UiPathVertex
151+
152+
`UiPathVertex` provides access to Google Vertex AI (Gemini) models through UiPath.
153+
154+
### Installation
155+
156+
This class requires additional dependencies. Install them with:
157+
158+
```bash
159+
pip install uipath-llamaindex[vertex]
160+
# or using uv:
161+
uv add 'uipath-llamaindex[vertex]'
162+
```
163+
164+
### Example Usage
165+
166+
```python
167+
from uipath_llamaindex.llms.vertex import UiPathVertex
168+
from uipath_llamaindex.llms import GeminiModel
169+
from llama_index.core.llms import ChatMessage
170+
171+
# Create an LLM instance with default settings
172+
llm = UiPathVertex()
173+
174+
# Or use a specific model
175+
llm = UiPathVertex(model=GeminiModel.gemini_2_5_pro)
176+
177+
# Create chat messages
178+
messages = [
179+
ChatMessage(role="user", content="Hello"),
180+
]
181+
182+
# Generate a response
183+
response = llm.chat(messages)
184+
print(response)
185+
```
186+
187+
Currently, the following models can be used (this list can be updated in the future):
188+
189+
- `gemini-2.0-flash-001`, `gemini-2.5-flash`, `gemini-2.5-pro`
100190

101191
## Integration with LlamaIndex
102192

103-
Both classes integrate seamlessly with LlamaIndex components:
193+
These classes integrate seamlessly with LlamaIndex components:
104194

105195
### Using with Agents
106196

@@ -121,7 +211,7 @@ def add(a: int, b: int) -> int:
121211
# Create agent with UiPath LLM
122212
agent = ReActAgent(
123213
tools=[multiply, add],
124-
llm=UiPathOpenAI(model=OpenAIModel.GPT_4O_2024_11_20))
214+
llm=UiPathOpenAI(model=OpenAIModel.GPT_4_1_2025_04_14))
125215

126216
async def main():
127217
handler = agent.run("What is 2+(2*4)?")
@@ -151,7 +241,7 @@ index = VectorStoreIndex.from_documents(
151241

152242
# Create query engine with UiPath LLM
153243
query_engine = index.as_query_engine(
154-
llm=UiPathOpenAI(model=OpenAIModel.GPT_4O_2024_11_20)
244+
llm=UiPathOpenAI(model=OpenAIModel.GPT_4_1_2025_04_14)
155245
)
156246

157247
response = query_engine.query("What is machine learning?")

packages/uipath-llamaindex/pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-llamaindex"
3-
version = "0.3.0"
3+
version = "0.4.1"
44
description = "UiPath LlamaIndex SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
@@ -10,8 +10,8 @@ dependencies = [
1010
"llama-index-embeddings-azure-openai>=0.4.1",
1111
"llama-index-llms-azure-openai>=0.4.2",
1212
"openinference-instrumentation-llama-index>=4.3.9",
13-
"uipath>=2.4.0, <2.5.0",
14-
"uipath-runtime>=0.4.0, <0.5.0",
13+
"uipath>=2.5.0, <2.6.0",
14+
"uipath-runtime>=0.5.0, <0.6.0",
1515
]
1616
classifiers = [
1717
"Intended Audience :: Developers",
@@ -58,7 +58,9 @@ dev = [
5858
"pytest>=7.4.0",
5959
"pytest-cov>=4.1.0",
6060
"pytest-mock>=3.11.1",
61-
"pre-commit>=4.1.0",
61+
"pre-commit>=4.5.1",
62+
"filelock>=3.20.3",
63+
"virtualenv>=20.36.1",
6264
"pytest-asyncio>=1.0.0",
6365
"numpy>=1.24.0",
6466
]

packages/uipath-llamaindex/samples/action-center-hitl-agent/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from uipath_llamaindex.models import CreateTaskEvent
1111

12-
llm = OpenAI(model="gpt-4o-mini")
12+
llm = OpenAI()
1313

1414

1515
async def may_research_company(ctx: Context, company_name: str) -> bool:

packages/uipath-llamaindex/samples/hitl-runtime-demo/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from llama_index.llms.openai import OpenAI
1212

1313
load_dotenv()
14-
llm = OpenAI(model="gpt-4o-mini")
14+
llm = OpenAI()
1515

1616

1717
async def may_research_company(ctx: Context, company_name: str) -> bool:

packages/uipath-llamaindex/samples/multi-agent/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from uipath_llamaindex.models import InvokeProcessEvent
1111

12-
llm = OpenAI(model="gpt-4o-mini")
12+
llm = OpenAI()
1313

1414

1515
async def may_research_company(ctx: Context, company_name: str) -> str:

packages/uipath-llamaindex/samples/simple-hitl-agent/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
)
77
from llama_index.llms.openai import OpenAI
88

9-
llm = OpenAI(model="gpt-4o-mini")
9+
llm = OpenAI()
1010

1111

1212
async def may_research_company(ctx: Context, company_name: str) -> bool:

packages/uipath-llamaindex/samples/simple-remote-mcp-agent/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async def process_query(self, ev: UserQueryEvent) -> AgentResponseEvent:
6464
self.agent = FunctionAgent(
6565
name="UiPath MCP Agent",
6666
description="An agent that can interact with MCP tools",
67-
llm=OpenAI(model="gpt-4o"),
67+
llm=OpenAI(),
6868
tools=tools,
6969
system_prompt="""You are a helpful assistant.
7070
You have access to various tools through MCP (Model Context Protocol).

packages/uipath-llamaindex/samples/travel-helper-RAG-agent/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
company_policy_files_directory = "sample_data/company_policies"
2525
personal_preferences_files_directory = "sample_data/personal_preferences"
2626

27-
llm = UiPathOpenAI(model="gpt-4o-2024-11-20")
27+
llm = UiPathOpenAI()
2828

2929

3030
class CustomStartEvent(StartEvent):

packages/uipath-llamaindex/src/uipath_llamaindex/llms/_openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
4444
class UiPathOpenAI(AzureOpenAI):
4545
def __init__(
4646
self,
47-
model: str | OpenAIModel = OpenAIModel.GPT_4O_MINI_2024_07_18,
47+
model: str | OpenAIModel = OpenAIModel.GPT_4_1_2025_04_14,
4848
api_version: str = "2024-10-21",
4949
**kwargs: Any,
5050
):

0 commit comments

Comments
 (0)