Skip to content

Commit 8932042

Browse files
authored
Version 1.5.0 - UiPathPlatformSettings / remove dependency from uipath, now it's using uipath-platform (#41)
1 parent 88ed4ff commit 8932042

33 files changed

Lines changed: 632 additions & 870 deletions

.env.example

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,38 @@
22
# UiPath LLM Client Configuration
33
# =============================================================================
44
# Copy this file to .env and fill in your values.
5-
# The client supports two backends: AgentHub (default) and LLMGateway.
5+
# The client supports three backends: AgentHub (default), Orchestrator, and LLMGateway.
66

77
# -----------------------------------------------------------------------------
88
# Backend Selection
99
# -----------------------------------------------------------------------------
10-
# Choose which backend to use: "agenthub" (default) or "llmgateway"
11-
UIPATH_LLM_BACKEND="agenthub"
10+
# Choose which backend to use: "agenthub" (default), "orchestrator", or "llmgateway"
11+
UIPATH_LLM_SERVICE="agenthub"
1212

1313
# =============================================================================
14-
# AGENTHUB BACKEND SETTINGS
14+
# PLATFORM BACKEND SETTINGS (AgentHub / Orchestrator)
1515
# =============================================================================
16-
# AgentHub uses the UiPath CLI for authentication by default.
17-
# Run `uv run uipath auth login` to authenticate interactively.
18-
# Alternatively, set the environment variables below.
19-
20-
# Environment selection: "cloud", "staging", or "alpha" (default: None)
21-
UIPATH_ENVIRONMENT=""
16+
# Both "agenthub" and "orchestrator" use PlatformSettings with the same
17+
# authentication. The EndpointManager selects the correct URL paths.
18+
# Run `uv run uipath auth login` to populate these automatically.
2219

2320
# Core settings (populated automatically by CLI auth, or set manually)
2421
UIPATH_URL=""
2522
UIPATH_ORGANIZATION_ID=""
2623
UIPATH_TENANT_ID=""
27-
28-
# Access token (short-lived, populated by CLI auth)
29-
# If not using CLI auth, provide this directly or use S2S credentials below
3024
UIPATH_ACCESS_TOKEN=""
3125

32-
# S2S Authentication for AgentHub (alternative to CLI/access token)
33-
UIPATH_CLIENT_ID=""
34-
UIPATH_CLIENT_SECRET=""
35-
UIPATH_CLIENT_SCOPE="" # Optional: custom OAuth scope
26+
# Optional: AgentHub discovery configuration (only used when backend is "agenthub")
27+
UIPATH_AGENTHUB_CONFIG="agentsruntime"
28+
29+
# Optional: tracing
30+
UIPATH_PROCESS_KEY=""
31+
UIPATH_JOB_KEY=""
3632

3733
# =============================================================================
3834
# LLMGATEWAY BACKEND SETTINGS
3935
# =============================================================================
40-
# To use LLMGateway, set UIPATH_LLM_BACKEND="llmgateway" above.
36+
# To use LLMGateway, set UIPATH_LLM_SERVICE="llmgateway" above.
4137

4238
# Required settings
4339
LLMGW_URL=""

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
needs: type_check
4848
environment: LLMGW_SETTINGS
4949
env:
50-
UIPATH_LLM_BACKEND: ${{ vars.UIPATH_LLM_BACKEND }}
50+
UIPATH_LLM_SERVICE: ${{ vars.UIPATH_LLM_SERVICE }}
5151
LLMGW_URL: ${{ vars.LLMGW_URL }}
5252
LLMGW_SEMANTIC_ORG_ID: ${{ secrets.LLMGW_SEMANTIC_ORG_ID }}
5353
LLMGW_SEMANTIC_USER_ID: ${{ secrets.LLMGW_SEMANTIC_USER_ID }}

CHANGELOG.md

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

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

5+
## [1.5.0] - 2026-03-16
6+
7+
### Stable Version 1.5.0
8+
- added also backend for orchestrator and renamed AgentHubSettings to PlatformSetting (contains both agenthub and orchestrator)
9+
- removed dependencies from 'uipath', now the repo depends on uipath.platform
10+
- renamed var UIPATH_LLM_BACKEND with UIPATH_LLM_SERVICE in order to match uipath.platform
11+
- More test fixes and documentation update
12+
513
## [1.4.0] - 2026-03-13
614

715
### New client

README.md

Lines changed: 87 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,22 @@ uv add "uipath-langchain-client[all]"
7070

7171
## Configuration
7272

73-
### AgentHub Backend (Default)
73+
### Platform Backend (AgentHub / Orchestrator)
7474

75-
The AgentHub backend uses the UiPath CLI for authentication. On first use, it will prompt you to log in via browser.
75+
The Platform backend uses the UiPath CLI for authentication. Both `"agenthub"` (default) and `"orchestrator"` share the same settings — the `EndpointManager` selects the correct URL paths automatically.
7676

7777
```bash
78-
# Optional: Pre-authenticate via CLI
78+
# Authenticate via CLI (populates .uipath/.auth.json)
7979
uv run uipath auth login
8080

8181
# Or set environment variables directly
82-
export UIPATH_ENVIRONMENT="cloud" # Environment: "cloud", "staging", or "alpha" (default: "cloud")
83-
export UIPATH_URL="https://cloud.uipath.com"
82+
export UIPATH_URL="https://cloud.uipath.com/org/tenant"
8483
export UIPATH_ORGANIZATION_ID="your-org-id"
8584
export UIPATH_TENANT_ID="your-tenant-id"
86-
export UIPATH_ACCESS_TOKEN="your-access-token" # Optional if using CLI auth
85+
export UIPATH_ACCESS_TOKEN="your-access-token"
8786

88-
# For S2S authentication (alternative to CLI)
89-
export UIPATH_CLIENT_ID="your-client-id"
90-
export UIPATH_CLIENT_SECRET="your-client-secret"
91-
export UIPATH_CLIENT_SCOPE="your-scope" # Optional: custom OAuth scope
87+
# Optional: select backend (default: "agenthub")
88+
export UIPATH_LLM_SERVICE="agenthub" # or "orchestrator"
9289
```
9390

9491
### LLMGateway Backend
@@ -97,7 +94,7 @@ To use the LLMGateway backend, set the following environment variables:
9794

9895
```bash
9996
# Select the backend
100-
export UIPATH_LLM_BACKEND="llmgateway"
97+
export UIPATH_LLM_SERVICE="llmgateway"
10198

10299
# Required configuration
103100
export LLMGW_URL="https://your-llmgw-url.com"
@@ -118,40 +115,91 @@ export LLMGW_SEMANTIC_USER_ID="your-user-id"
118115

119116
## Settings Reference
120117

121-
### AgentHubSettings
118+
### PlatformSettings
122119

123-
Configuration settings for UiPath AgentHub client requests. These settings control routing, authentication, and tracking for requests to AgentHub.
120+
Configuration settings for UiPath Platform client requests. `PlatformSettings` is a unified settings class that serves both **AgentHub** and **Orchestrator** backends — the `EndpointManager` transparently selects the correct endpoints based on service availability.
121+
122+
You choose between them via the `UIPATH_LLM_SERVICE` environment variable (or the `backend` parameter in `get_default_client_settings()`):
123+
124+
| Value | Description |
125+
|-------|-------------|
126+
| `"agenthub"` (default) | Routes requests through AgentHub endpoints |
127+
| `"orchestrator"` | Routes requests through Orchestrator endpoints |
128+
129+
Both values create a `PlatformSettings` instance — the difference is in how `EndpointManager` resolves the URL paths.
124130

125131
```python
126-
from uipath.llm_client.settings import AgentHubSettings
127-
128-
settings = AgentHubSettings(
129-
environment="cloud", # UiPath environment
130-
access_token="...", # Optional: pre-set access token
131-
base_url="...", # Optional: custom base URL
132-
tenant_id="...", # Optional: tenant ID
133-
organization_id="...", # Optional: organization ID
134-
)
132+
from uipath.llm_client.settings import get_default_client_settings, PlatformSettings
133+
134+
# Option 1: Factory (reads UIPATH_LLM_SERVICE, defaults to "agenthub")
135+
settings = get_default_client_settings()
136+
137+
# Option 2: Explicit backend
138+
settings = get_default_client_settings(backend="agenthub")
139+
settings = get_default_client_settings(backend="orchestrator")
140+
141+
# Option 3: Direct instantiation
142+
settings = PlatformSettings()
135143
```
136144

145+
#### AgentHub
146+
147+
AgentHub is the default backend. It routes LLM requests through UiPath's AgentHub service, which provides model discovery, routing, and tracing capabilities.
148+
149+
```bash
150+
# Select the backend (default, can be omitted)
151+
export UIPATH_LLM_SERVICE="agenthub"
152+
153+
# Core settings (populated automatically by `uipath auth login`)
154+
export UIPATH_URL="https://cloud.uipath.com/org/tenant"
155+
export UIPATH_ORGANIZATION_ID="your-org-id"
156+
export UIPATH_TENANT_ID="your-tenant-id"
157+
export UIPATH_ACCESS_TOKEN="your-access-token"
158+
159+
# Optional: AgentHub configuration for discovery (default: "agentsruntime")
160+
export UIPATH_AGENTHUB_CONFIG="agentsruntime"
161+
162+
# Optional: tracing
163+
export UIPATH_PROCESS_KEY="your-process-key"
164+
export UIPATH_JOB_KEY="your-job-key"
165+
```
166+
167+
#### Orchestrator
168+
169+
Orchestrator uses the same `PlatformSettings` and authentication as AgentHub, but routes requests through Orchestrator endpoints instead.
170+
171+
```bash
172+
# Select the backend
173+
export UIPATH_LLM_SERVICE="orchestrator"
174+
175+
# Core settings (same as AgentHub)
176+
export UIPATH_URL="https://cloud.uipath.com/org/tenant"
177+
export UIPATH_ORGANIZATION_ID="your-org-id"
178+
export UIPATH_TENANT_ID="your-tenant-id"
179+
export UIPATH_ACCESS_TOKEN="your-access-token"
180+
181+
# Optional: tracing
182+
export UIPATH_PROCESS_KEY="your-process-key"
183+
export UIPATH_JOB_KEY="your-job-key"
184+
```
185+
186+
#### PlatformSettings Attributes
187+
137188
| Attribute | Environment Variable | Type | Default | Description |
138189
|-----------|---------------------|------|---------|-------------|
139-
| `environment` | `UIPATH_ENVIRONMENT` | `"cloud"` \| `"staging"` \| `"alpha"` | `"cloud"` | The UiPath environment to connect to |
140-
| `access_token` | `UIPATH_ACCESS_TOKEN` | `SecretStr \| None` | `None` | Access token for authentication (auto-populated via CLI if not set) |
141-
| `base_url` | `UIPATH_URL` | `str \| None` | `None` | Base URL of the AgentHub API (auto-populated via CLI if not set) |
142-
| `tenant_id` | `UIPATH_TENANT_ID` | `str \| None` | `None` | Tenant ID for request routing (auto-populated via CLI if not set) |
143-
| `organization_id` | `UIPATH_ORGANIZATION_ID` | `str \| None` | `None` | Organization ID for request routing (auto-populated via CLI if not set) |
144-
| `client_id` | `UIPATH_CLIENT_ID` | `SecretStr \| None` | `None` | Client ID for OAuth/S2S authentication |
145-
| `client_secret` | `UIPATH_CLIENT_SECRET` | `SecretStr \| None` | `None` | Client secret for OAuth/S2S authentication |
146-
| `client_scope` | `UIPATH_CLIENT_SCOPE` | `str \| None` | `None` | Custom OAuth scope for authentication |
147-
| `agenthub_config` | `UIPATH_AGENTHUB_CONFIG` | `str` | `"agentsruntime"` | AgentHub configuration for tracing |
190+
| `access_token` | `UIPATH_ACCESS_TOKEN` | `SecretStr \| None` | `None` | Access token for authentication (populated by `uipath auth login`) |
191+
| `base_url` | `UIPATH_URL` | `str \| None` | `None` | Base URL of the UiPath Platform API |
192+
| `tenant_id` | `UIPATH_TENANT_ID` | `str \| None` | `None` | Tenant ID for request routing |
193+
| `organization_id` | `UIPATH_ORGANIZATION_ID` | `str \| None` | `None` | Organization ID for request routing |
194+
| `agenthub_config` | `UIPATH_AGENTHUB_CONFIG` | `str \| None` | `"agentsruntime"` | AgentHub configuration for discovery |
148195
| `process_key` | `UIPATH_PROCESS_KEY` | `str \| None` | `None` | Process key for tracing |
149196
| `job_key` | `UIPATH_JOB_KEY` | `str \| None` | `None` | Job key for tracing |
150197

151198
**Authentication behavior:**
152-
- If `access_token`, `base_url`, `tenant_id`, and `organization_id` are all provided, they are used directly
153-
- Otherwise, the client uses the UiPath CLI (`uipath auth`) to authenticate automatically
154-
- For S2S authentication, provide `client_id` and `client_secret`
199+
- All four core fields (`access_token`, `base_url`, `tenant_id`, `organization_id`) are required
200+
- Run `uipath auth login` to populate them automatically via the UiPath CLI
201+
- The access token is validated against the local `.uipath/.auth.json` file
202+
- Token refresh is handled automatically using the refresh token from the auth file
155203

156204
### LLMGatewaySettings
157205

@@ -463,11 +511,11 @@ Pass custom settings when you need more control:
463511

464512
```python
465513
from uipath_langchain_client.clients.openai.chat_models import UiPathAzureChatOpenAI
466-
from uipath.llm_client.settings import AgentHubSettings
514+
from uipath.llm_client.settings import PlatformSettings
467515
from uipath.llm_client.utils.retry import RetryConfig
468516

469-
# Custom settings for AgentHub
470-
settings = AgentHubSettings(environment="cloud") # or "staging", "alpha"
517+
# Custom settings for Platform (AgentHub/Orchestrator)
518+
settings = PlatformSettings()
471519

472520
# With retry configuration
473521
retry_config: RetryConfig = {
@@ -498,7 +546,7 @@ llmgw_settings = get_default_client_settings(backend="llmgateway")
498546
chat = UiPathAzureChatOpenAI(model="gpt-4o-2024-11-20", client_settings=llmgw_settings)
499547

500548
# Or use environment variable (no code changes needed)
501-
# export UIPATH_LLM_BACKEND="llmgateway"
549+
# export UIPATH_LLM_SERVICE="llmgateway"
502550
```
503551

504552
### Using LLMGatewaySettings Directly
@@ -810,7 +858,7 @@ uipath-llm-client/
810858
│ │ └── google/ # UiPathGoogle
811859
│ ├── settings/ # Backend-specific settings & auth
812860
│ │ ├── base.py # UiPathBaseSettings, UiPathAPIConfig
813-
│ │ ├── agenthub/ # AgentHubSettings, AgentHubAuth
861+
│ │ ├── platform/ # PlatformSettings, PlatformAuth
814862
│ │ └── llmgateway/ # LLMGatewaySettings, LLMGatewayS2SAuth
815863
│ └── utils/ # Exceptions, retry, logging, SSL
816864
│ ├── exceptions.py # UiPathAPIError hierarchy (12 classes)

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.0] - 2026-03-16
6+
7+
### Stable Version 1.5.0
8+
- Updated package to include the changes in core
9+
510
## [1.4.0] - 2026-03-13
611

712
### New client

packages/uipath_langchain_client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The factory functions automatically detect the model vendor and return the appro
2929
from uipath_langchain_client import get_chat_model, get_embedding_model
3030
from uipath_langchain_client.settings import get_default_client_settings
3131

32-
# Get default settings (uses UIPATH_LLM_BACKEND env var or defaults to AgentHub)
32+
# Get default settings (uses UIPATH_LLM_SERVICE env var or defaults to AgentHub)
3333
settings = get_default_client_settings()
3434

3535
# Chat model - vendor auto-detected from model name

packages/uipath_langchain_client/pyproject.toml

Lines changed: 3 additions & 3 deletions
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.4.0",
9+
"uipath-llm-client>=1.5.0",
1010
]
1111

1212
[project.optional-dependencies]
@@ -17,8 +17,8 @@ google = [
1717
"langchain-google-genai>=4.2.1",
1818
]
1919
anthropic = [
20-
"langchain-anthropic>=1.3.4",
21-
"anthropic[bedrock,vertex]>=0.84.0",
20+
"langchain-anthropic>=1.3.5",
21+
"anthropic[bedrock,vertex]>=0.85.0",
2222
]
2323
aws = [
2424
"langchain-aws[anthropic]>=1.4.0",

packages/uipath_langchain_client/src/uipath_langchain_client/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
2525
Settings:
2626
- get_default_client_settings(): Auto-detect backend from environment
27-
- AgentHubSettings: UiPath AgentHub backend (CLI-based auth)
27+
- PlatformSettings: UiPath Platform backend (AgentHub/Orchestrator, CLI-based auth)
2828
- LLMGatewaySettings: UiPath LLM Gateway backend (S2S auth)
2929
3030
Factory Functions:
@@ -36,8 +36,8 @@
3636
from uipath_langchain_client.clients import UiPathChat, UiPathEmbeddings
3737
from uipath_langchain_client.factory import get_chat_model, get_embedding_model
3838
from uipath_langchain_client.settings import (
39-
AgentHubSettings,
4039
LLMGatewaySettings,
40+
PlatformSettings,
4141
get_default_client_settings,
4242
)
4343

@@ -49,5 +49,5 @@
4949
"UiPathEmbeddings",
5050
"get_default_client_settings",
5151
"LLMGatewaySettings",
52-
"AgentHubSettings",
52+
"PlatformSettings",
5353
]
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.4.0"
3+
__version__ = "1.5.0"

packages/uipath_langchain_client/src/uipath_langchain_client/base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class UiPathBaseLLMClient(BaseModel, ABC):
9898
client_settings: UiPathBaseSettings = Field(
9999
alias="settings",
100100
default_factory=get_default_client_settings,
101-
description="Settings for the UiPath client (defaults based on UIPATH_LLM_BACKEND env var)",
101+
description="Settings for the UiPath client (defaults based on UIPATH_LLM_SERVICE env var)",
102102
)
103103

104104
default_headers: Mapping[str, str] | None = Field(

0 commit comments

Comments
 (0)