Skip to content

Commit a4ce202

Browse files
aditik0303claude
andcommitted
chore(governance): restore SETUP.MD and llms doc that belong to main
An earlier cleanup commit compared against a stale local main and wrongly removed SETUP.MD and reverted the LlamaIndex docs change. Both files come from main (PRs #352/#356), not this branch. Restore them to the main version so this PR is governance-only with no spurious deletions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a9275df commit a4ce202

2 files changed

Lines changed: 178 additions & 19 deletions

File tree

SETUP.MD

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# SETUP.MD
2+
3+
This file documents how to provision a clean development environment for the five packages in this repo (`uipath-agent-framework`, `uipath-google-adk`, `uipath-llamaindex`, `uipath-openai-agents`, `uipath-pydantic-ai`), run the build, execute the tests, and validate a sample code change end-to-end. It is intended both as a quick reference for human contributors and as a structured guide for automated environment-setup tooling.
4+
5+
## Prerequisites
6+
7+
- Python 3.11+
8+
- [uv](https://docs.astral.sh/uv/) 0.5+
9+
10+
### Supported platforms
11+
12+
`uv` is shell- and OS-agnostic, so the commands below run unchanged on every supported platform:
13+
14+
- [x] Linux
15+
- [x] Windows
16+
- [x] macOS
17+
18+
## Environment Variables
19+
20+
None required for environment setup, build, or unit tests. The suites under the `Test` section run fully offline and require no external authentication.
21+
22+
> **All commands below must be run from the repository root.** The `uv --directory packages/<name>` invocations resolve each subpackage relative to the current working directory. The first line of `## Setup` enforces this by `cd`-ing to the git root.
23+
24+
## Setup
25+
26+
```bash
27+
cd "$(git rev-parse --show-toplevel)"
28+
python3 -m pip install --upgrade uv
29+
30+
# Sync all five packages (each is independent)
31+
uv --directory packages/uipath-agent-framework sync --all-extras
32+
uv --directory packages/uipath-google-adk sync --all-extras
33+
uv --directory packages/uipath-llamaindex sync --all-extras
34+
uv --directory packages/uipath-openai-agents sync --all-extras
35+
uv --directory packages/uipath-pydantic-ai sync --all-extras
36+
```
37+
38+
## Verify Setup
39+
40+
```bash
41+
uv --version
42+
uv --directory packages/uipath-pydantic-ai run python --version
43+
uv --directory packages/uipath-agent-framework run python -c "import uipath_agent_framework; print('uipath-agent-framework ok')"
44+
uv --directory packages/uipath-google-adk run python -c "import uipath_google_adk; print('uipath-google-adk ok')"
45+
uv --directory packages/uipath-llamaindex run python -c "import uipath_llamaindex; print('uipath-llamaindex ok')"
46+
uv --directory packages/uipath-openai-agents run python -c "import uipath_openai_agents; print('uipath-openai-agents ok')"
47+
uv --directory packages/uipath-pydantic-ai run python -c "import uipath_pydantic_ai; print('uipath-pydantic-ai ok')"
48+
```
49+
50+
## Build
51+
52+
N/A
53+
54+
## Test
55+
56+
```bash
57+
uv --directory packages/uipath-agent-framework run pytest
58+
uv --directory packages/uipath-google-adk run pytest
59+
uv --directory packages/uipath-llamaindex run pytest
60+
uv --directory packages/uipath-openai-agents run pytest
61+
uv --directory packages/uipath-pydantic-ai run pytest
62+
```
63+
64+
## Sample Code Change
65+
66+
### The change
67+
68+
Add a new `agent_count` property to `PydanticAiConfig` in `packages/uipath-pydantic-ai/src/uipath_pydantic_ai/runtime/config.py`, immediately after the existing `entrypoint` property:
69+
70+
```python
71+
@property
72+
def agent_count(self) -> int:
73+
"""Number of agents defined in the configuration."""
74+
return len(self.agents)
75+
```
76+
77+
Then create `packages/uipath-pydantic-ai/tests/test_config_agent_count.py` with two pytest tests:
78+
79+
```python
80+
"""Tests for PydanticAiConfig.agent_count."""
81+
82+
import json
83+
from pathlib import Path
84+
85+
from uipath_pydantic_ai.runtime.config import PydanticAiConfig
86+
87+
88+
def test_agent_count_single(tmp_path: Path) -> None:
89+
config_path = tmp_path / "pydantic_ai.json"
90+
config_path.write_text(json.dumps({"agents": {"main": "main:agent"}}))
91+
cfg = PydanticAiConfig(str(config_path))
92+
assert cfg.agent_count == 1
93+
94+
95+
def test_agent_count_multiple(tmp_path: Path) -> None:
96+
config_path = tmp_path / "pydantic_ai.json"
97+
config_path.write_text(
98+
json.dumps(
99+
{
100+
"agents": {
101+
"alpha": "alpha:agent",
102+
"beta": "beta:agent",
103+
"gamma": "gamma:agent",
104+
}
105+
}
106+
)
107+
)
108+
cfg = PydanticAiConfig(str(config_path))
109+
assert cfg.agent_count == 3
110+
```
111+
112+
### Verification
113+
114+
```bash
115+
uv --directory packages/uipath-pydantic-ai run pytest tests/test_config_agent_count.py -v
116+
```
117+
118+
## Test with a real UiPath Coded Agent
119+
120+
The unit tests above are necessary but not sufficient — they don't exercise the package end-to-end through a real agent. The flow below validates changes against a live runtime:
121+
122+
1. Apply the code changes locally.
123+
2. Run the unit tests (see the `Sample Code Change` section above).
124+
3. Scaffold a coded UiPath agent (PydanticAI / OpenAI / Google ADK / LlamaIndex / Agent Framework, matching the package you changed) that exercises the changed code path.
125+
4. In the downstream project's `pyproject.toml`, add this local library as an editable dependency (substitute the package you changed):
126+
127+
```toml
128+
[tool.uv.sources]
129+
uipath-pydantic-ai = { path = "../path/to/uipath-integrations-python/packages/uipath-pydantic-ai", editable = true }
130+
```
131+
132+
5. Exercise the new behavior end-to-end:
133+
134+
```bash
135+
uv run uipath run <agent-name> --input '{...}'
136+
```
137+
138+
6. (Optional) Open a PR and apply the `build:dev` label — this publishes the development version to Test PyPI.
139+
7. The PR description is updated automatically with instructions for pointing the downstream agent at the Test PyPI dev version.
140+
8. Push the dev version to UiPath with [`uipath push`](https://uipath.github.io/uipath-python/cli/#push), then deploy it to Orchestrator or Studio Web with [`uipath deploy`](https://uipath.github.io/uipath-python/cli/#deploy), and run it in cloud to confirm the changes behave correctly against the real platform.
141+
9. Once validation is done, close the dev PR — these PRs are not meant to be merged; their only purpose was to publish a Test PyPI build for end-to-end validation.

packages/uipath-llamaindex/docs/llms_and_embeddings.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,47 @@
11
# LLMs and Embeddings
22

3-
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 API keys from OpenAI, AWS, or Google, usage of these models will consume `Agent Units` on your account.
3+
UiPath provides pre-configured LLM and embedding classes for several providers (OpenAI via `UiPathOpenAI`, Anthropic on AWS Bedrock via `UiPathChatBedrockConverse`, Google Vertex AI via `UiPathVertex`, and more), plus embeddings via `UiPathOpenAIEmbedding`. These handle authentication, routing, and configuration automatically, allowing you to focus on building your agents. You do not need to add API keys from OpenAI, AWS, or Google, usage of these models will consume `Agent Units` on your account.
4+
5+
## Available models
6+
7+
LLM models are served through the UiPath LLM Gateway and are subject to [AI Trust Layer](https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/about-ai-trust-layer) policies, so the exact set of models available to you depends on your tenant configuration. List the models you can use with the `uipath` CLI:
8+
9+
```console
10+
$ uipath list-models
11+
Available LLM Models
12+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
13+
┃ AwsBedrock ┃ OpenAi ┃ VertexAi ┃
14+
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
15+
│ anthropic.claude-haiku-4-5-20251001-v1:0 │ gpt-4.1-2025-04-14 │ gemini-2.5-flash │
16+
│ anthropic.claude-opus-4-7 │ gpt-4.1-mini-2025-04-14 │ gemini-2.5-pro │
17+
│ ... │ ... │ ... │
18+
└──────────────────────────────────────────┴─────────────────────────┴──────────────────┘
19+
```
20+
21+
Pick a model id from the relevant provider column and pass it (or the matching enum member) to the matching class:
22+
23+
```python
24+
from uipath_llamaindex.llms import UiPathOpenAI
25+
from uipath_llamaindex.llms.bedrock import UiPathChatBedrockConverse
26+
from uipath_llamaindex.llms.vertex import UiPathVertex
27+
28+
# OpenAI models
29+
llm = UiPathOpenAI(model="gpt-4.1-mini-2025-04-14")
30+
31+
# AWS Bedrock (Anthropic) models
32+
llm = UiPathChatBedrockConverse(model="anthropic.claude-sonnet-4-5-20250929-v1:0")
33+
34+
# Google Vertex AI (Gemini) models
35+
llm = UiPathVertex(model="gemini-2.5-flash")
36+
```
537

638
## UiPathOpenAI
739

840
The `UiPathOpenAI` class is a pre-configured Azure OpenAI client that routes requests through UiPath.
941

1042
### Available Models
1143

12-
The following OpenAI models are available through the `OpenAIModel` enum:
13-
14-
- `GPT_4_1_2025_04_14`
15-
- `GPT_4_1_MINI_2025_04_14`
16-
- `GPT_4_1_NANO_2025_04_14`
17-
- `GPT_4O_2024_05_13`
18-
- `GPT_4O_2024_08_06`
19-
- `GPT_4O_2024_11_20`
20-
- `GPT_4O_MINI_2024_07_18` (default)
21-
- `O3_MINI_2025_01_31`
22-
- `TEXT_DAVINCI_003`
44+
The OpenAI models from the `OpenAi` column of [`uipath list-models`](#available-models) can be used here, either as a model string or via the `OpenAIModel` enum.
2345

2446
### Basic Usage
2547

@@ -143,9 +165,7 @@ from uipath_llamaindex.llms import BedrockModel
143165
llm = UiPathChatBedrock(model=BedrockModel.anthropic_claude_sonnet_4)
144166
```
145167

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`
168+
The available models are the ones in the `AwsBedrock` column of [`uipath list-models`](#available-models).
149169

150170
## UiPathVertex
151171

@@ -184,9 +204,7 @@ response = llm.chat(messages)
184204
print(response)
185205
```
186206

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`
207+
The available models are the ones in the `VertexAi` column of [`uipath list-models`](#available-models).
190208

191209
## Integration with LlamaIndex
192210

0 commit comments

Comments
 (0)