@@ -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)
7979uv 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"
8483export UIPATH_ORGANIZATION_ID=" your-org-id"
8584export 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
103100export 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
465513from 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
467515from 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
473521retry_config: RetryConfig = {
@@ -498,7 +546,7 @@ llmgw_settings = get_default_client_settings(backend="llmgateway")
498546chat = 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)
0 commit comments