Skip to content

Commit 335d7bc

Browse files
alexandra-cclaude
andauthored
docs(studio-web): document coded function integration [PRODEV-605] (#1675)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bf200a3 commit 335d7bc

15 files changed

Lines changed: 892 additions & 50 deletions

packages/uipath/docs/FAQ.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Frequently Asked Questions (FAQ)
22

3-
### Q: Why am I getting a "Failed to prepare environment" error when deploying my python agent to UiPath Cloud Platform?
3+
### Q: Why am I getting a "Failed to prepare environment" error when deploying my Python project to UiPath Cloud Platform?
44

55
#### Error Message
66

@@ -30,7 +30,7 @@
3030

3131
#### Description
3232

33-
This error might occur when deploying coded-agents to UiPath Cloud Platform, even though the same project might work correctly in your local environment. The issue is often related to how Python packages are discovered and distributed during the cloud deployment process.
33+
This error might occur when deploying coded functions or coded agents to UiPath Cloud Platform, even though the same project might work correctly in your local environment. The issue is often related to how Python packages are discovered and distributed during the cloud deployment process.
3434

3535
#### Common Causes
3636

@@ -283,7 +283,7 @@ If you encounter SSL certificate errors:
283283
////
284284

285285

286-
### Q: Why are my agent runs hanging on UiPath Cloud Platform?
286+
### Q: Why are my job runs hanging on UiPath Cloud Platform?
287287

288288
#### Error Message
289289

@@ -298,7 +298,7 @@ You may see errors like these in the logs panel:
298298

299299
#### Description
300300

301-
If your Python agent runs are hanging or not completing when deployed to UiPath Cloud Platform's serverless environment, this may be caused by a library incompatibility issue from an outdated version of the UiPath Python library.
301+
If your Python job runs are hanging or not completing when deployed to UiPath Cloud Platform's serverless environment, this may be caused by a library incompatibility issue from an outdated version of the UiPath Python library.
302302

303303
#### Solution
304304

packages/uipath/docs/cli/index.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# CLI Reference
22

3+
The following commands apply to both **coded functions** and **coded agents**. The entry point name (`main`, `agent`, or any key you define in `uipath.json`) is the first argument to `run`, `debug`, `eval`, and `invoke`.
4+
35
::: mkdocs-click
46
:module: uipath._cli
57
:command: auth
@@ -132,7 +134,7 @@ For step-by-step debugging with breakpoints and variable inspection (supported f
132134
```console
133135
# Install debugpy package
134136
uv pip install debugpy
135-
# Run agent with debugging enabled
137+
# Run with debugging enabled
136138
uipath run [ENTRYPOINT] [INPUT] --debug
137139
```
138140
For vscode:
@@ -154,19 +156,19 @@ Depending on the shell you are using, it may be necessary to escape the input js
154156

155157
/// tab | Bash/ZSH
156158
```console
157-
uipath run agent '{"topic": "UiPath"}'
159+
uipath run main '{"message": "hello"}'
158160
```
159161
///
160162

161163
/// tab | Windows CMD
162164
```console
163-
uipath run agent "{""topic"": ""UiPath""}"
165+
uipath run main "{""message"": ""hello""}"
164166
```
165167
///
166168

167169
/// tab | Windows PowerShell
168170
```console
169-
uipath run agent '{\"topic\":\"uipath\"}'
171+
uipath run main '{\"message\":\"hello\"}'
170172
```
171173
///
172174

@@ -312,7 +314,7 @@ Selected feed: Orchestrator Tenant Processes Feed
312314
<!-- termynal -->
313315

314316
```shell
315-
> uipath invoke agent '{"topic": "UiPath"}'
317+
> uipath invoke main '{"message": "hello"}'
316318
⠴ Loading configuration ...
317319
⠴ Starting job ...
318320
✨ Job started successfully!
@@ -380,7 +382,7 @@ File 'uipath.json' is up to date
380382
:depth: 1
381383
:style: table
382384

383-
Runs your agent under the debug runtime, with a debug bridge attached. Locally, the bridge is the interactive **console** (read commands from stdin, stop at breakpoints). In the cloud, the bridge is **SignalR** (driven by Studio Web / Orchestrator). The `--attach` flag lets you override that default, including `none` for executors that need the debug command's surrounding behavior (bindings fetch, state streaming) but cannot speak the interactive debug protocol.
385+
Runs your project under the debug runtime, with a debug bridge attached. Locally, the bridge is the interactive **console** (read commands from stdin, stop at breakpoints). In the cloud, the bridge is **SignalR** (driven by Studio Web / Orchestrator). The `--attach` flag lets you override that default, including `none` for executors that need the debug command's surrounding behavior (bindings fetch, state streaming) but cannot speak the interactive debug protocol.
384386

385387
### Attach modes
386388

@@ -427,7 +429,7 @@ Next: analyze_sentiment
427429
:depth: 1
428430
:style: table
429431
430-
Runs an evaluation set against your agent. Entry point and eval set are auto-discovered from the project if not passed explicitly. Evaluations run in parallel (see `--workers`) and, unless `--no-report` is passed, results are reported back to Studio Web when `UIPATH_PROJECT_ID` is set.
432+
Runs an evaluation set against your project. Entry point and eval set are auto-discovered from the project if not passed explicitly. Evaluations run in parallel (see `--workers`) and, unless `--no-report` is passed, results are reported back to Studio Web when `UIPATH_PROJECT_ID` is set.
431433
432434
### Common flags
433435
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
# Python Coded Agents
2+
3+
A coded agent is Python code that uses an LLM reasoning loop to make decisions, call tools, and produce a result. You write the agent logic using a framework of your choice — the `uipath` SDK provides the platform layer: authentication, assets, buckets, connections, tracing, and human-in-the-loop. Package it with the CLI and deploy it as an Orchestrator job.
4+
5+
Use a coded agent when your automation needs multi-step reasoning, dynamic tool selection, or LLM-driven decisions. Use a [coded function](./functions.md) when your logic is deterministic and no LLM is required.
6+
7+
---
8+
9+
## Architecture
10+
11+
Every coded agent is built from two layers:
12+
13+
| Layer | Package | Responsibility |
14+
|-------|---------|---------------|
15+
| **Platform** | `uipath` | Auth, assets, buckets, connections, tracing, human-in-the-loop, CLI, packaging |
16+
| **Framework** | one extension (see below) | LLM calls, tool routing, agent loop, memory |
17+
18+
The `uipath` package is always required. Add one framework extension on top:
19+
20+
| Framework | Package | Best for |
21+
|-----------|---------|---------|
22+
| LangChain / LangGraph | `uipath-langchain` | Graph-based agents, complex multi-step flows |
23+
| LlamaIndex | `uipath-llamaindex` | RAG-heavy agents, document reasoning |
24+
| OpenAI Agents SDK | `uipath-openai-agents` | OpenAI-native tool use, handoffs |
25+
| PydanticAI | `uipath-pydantic-ai` | Type-safe agents with Pydantic models |
26+
| Google ADK | `uipath-google-adk` | Gemini models, Google ecosystem |
27+
| UiPath Agent Framework | `uipath-agent-framework` | UiPath-native agent primitives |
28+
29+
---
30+
31+
## Quickstart
32+
33+
The example below uses LangChain. Swap `uipath-langchain` for the framework of your choice.
34+
35+
//// tab | uv
36+
37+
<!-- termynal -->
38+
39+
```shell
40+
> mkdir my-agent && cd my-agent
41+
> uv init . --python 3.11
42+
> uv add uipath uipath-langchain
43+
44+
> uipath auth
45+
⠋ Authenticating with UiPath ...
46+
✓ Authentication successful.
47+
48+
> uipath new agent
49+
✓ Created new agent project.
50+
51+
> uipath init
52+
⠋ Initializing UiPath project ...
53+
✓ Created 'entry-points.json' file.
54+
✓ Created 'bindings.json' file.
55+
56+
> uipath run agent '{"message": "hello"}'
57+
```
58+
59+
////
60+
61+
//// tab | pip
62+
63+
<!-- termynal -->
64+
65+
```shell
66+
> mkdir my-agent && cd my-agent
67+
> python -m venv .venv
68+
> source .venv/bin/activate
69+
> pip install uipath uipath-langchain
70+
71+
> uipath auth
72+
⠋ Authenticating with UiPath ...
73+
✓ Authentication successful.
74+
75+
> uipath new agent
76+
✓ Created new agent project.
77+
78+
> uipath init
79+
⠋ Initializing UiPath project ...
80+
✓ Created 'entry-points.json' file.
81+
✓ Created 'bindings.json' file.
82+
83+
> uipath run agent '{"message": "hello"}'
84+
```
85+
86+
////
87+
88+
---
89+
90+
## Project Structure
91+
92+
```
93+
my-agent/
94+
├── main.py # agent logic
95+
├── pyproject.toml # project metadata and dependencies
96+
├── uipath.json # entry point declarations
97+
├── entry-points.json # generated — I/O JSON Schema
98+
└── bindings.json # generated — resource binding overrides
99+
```
100+
101+
### `uipath.json`
102+
103+
```json
104+
{
105+
"agents": {
106+
"agent": "main.py:agent"
107+
}
108+
}
109+
```
110+
111+
### `pyproject.toml`
112+
113+
```toml
114+
[project]
115+
name = "my-agent"
116+
version = "0.1.0"
117+
description = "..."
118+
authors = [{ name = "Your Name", email = "you@example.com" }]
119+
requires-python = ">=3.11"
120+
dependencies = ["uipath>=2.0", "uipath-langchain>=2.0"]
121+
122+
[tool.uipath]
123+
type = "agent"
124+
```
125+
126+
`[tool.uipath] type = "agent"` is required — it identifies the project as an agent to the runtime and packaging tools.
127+
128+
---
129+
130+
## Input & Output
131+
132+
Define `Input` and `Output` as Python dataclasses, the same way as [coded functions](./functions.md#input--output):
133+
134+
```python
135+
from dataclasses import dataclass
136+
137+
138+
@dataclass
139+
class Input:
140+
message: str
141+
142+
143+
@dataclass
144+
class Output:
145+
response: str
146+
147+
148+
def agent(input: Input) -> Output:
149+
...
150+
```
151+
152+
---
153+
154+
## Platform Services
155+
156+
The `uipath` SDK gives your agent access to Orchestrator resources at runtime — credentials are injected automatically when running as a job.
157+
158+
```python
159+
from uipath.platform import UiPath
160+
161+
sdk = UiPath()
162+
```
163+
164+
The full set of Orchestrator services is available to agents:
165+
166+
- **Assets** — read credentials and configuration: [Assets reference](./assets.md)
167+
- **Buckets** — download and upload files: [Buckets reference](./buckets.md)
168+
- **Connections** — Integration Service connections for ERP and SaaS: [Connections reference](./connections.md)
169+
- **Context Grounding** — semantic search over enterprise data: [Context Grounding reference](./context_grounding.md)
170+
171+
---
172+
173+
## Tracing
174+
175+
Apply `@traced` to custom steps inside your agent to make them visible in the Orchestrator job trace view and Maestro dashboards. Do **not** trace the entry point — the runtime wraps it automatically.
176+
177+
```python
178+
from uipath.tracing import traced
179+
180+
181+
@traced(name="lookup_vendor", run_type="uipath")
182+
def lookup_vendor(vendor_id: str) -> dict:
183+
...
184+
```
185+
186+
See [Tracing](./traced.md) for the full decorator reference.
187+
188+
---
189+
190+
## Framework Guides
191+
192+
Each framework extension has its own getting started guide and sample agents:
193+
194+
| Framework | Guide | Samples |
195+
|-----------|-------|---------|
196+
| LangChain / LangGraph | [Get Started](../langchain/quick_start.md) | [Samples](https://github.com/UiPath/uipath-langchain-python/tree/main/samples) |
197+
| LlamaIndex | [Get Started](../llamaindex/quick_start.md) | [Samples](https://github.com/UiPath/uipath-integrations-python/tree/main/packages/uipath-llamaindex/samples) |
198+
| OpenAI Agents SDK | [Get Started](../openai-agents/quick_start.md) | [Samples](https://github.com/UiPath/uipath-integrations-python/tree/main/packages/uipath-openai-agents/samples) |
199+
| PydanticAI | [README](https://github.com/UiPath/uipath-integrations-python/blob/main/packages/uipath-pydantic-ai/README.md) | [Samples](https://github.com/UiPath/uipath-integrations-python/tree/main/packages/uipath-pydantic-ai/samples) |
200+
| Google ADK | [README](https://github.com/UiPath/uipath-integrations-python/blob/main/packages/uipath-google-adk/README.md) | [Samples](https://github.com/UiPath/uipath-integrations-python/tree/main/packages/uipath-google-adk/samples) |
201+
| UiPath Agent Framework | [README](https://github.com/UiPath/uipath-integrations-python/blob/main/packages/uipath-agent-framework/README.md) | [Samples](https://github.com/UiPath/uipath-integrations-python/tree/main/packages/uipath-agent-framework/samples) |
202+
203+
204+
---
205+
206+
## Pack & Publish
207+
208+
The same CLI workflow applies as for coded functions:
209+
210+
<!-- termynal -->
211+
212+
```shell
213+
> uipath pack
214+
⠋ Packaging project ...
215+
Name : my-agent
216+
Version : 0.1.0
217+
Description: Add your description here
218+
Authors : Your Name
219+
✓ Project successfully packaged.
220+
221+
> uipath publish
222+
⠋ Fetching available package feeds...
223+
Select feed number: 0
224+
✓ Package published successfully!
225+
```
226+
227+
After publishing, the agent registers as an Orchestrator Process and can be invoked from Maestro, the Orchestrator API, or the CLI.
228+
229+
See [CLI Reference](../cli/index.md) for full `pack`, `publish`, and `invoke` options.
230+
231+
---
232+
233+
## Studio Web Integration
234+
235+
Connect your agent to a Studio Web solution for cloud debugging, evaluation, and solution packaging.
236+
237+
See [Studio Web Integration](./studio_web.md) for setup and sync details.
238+
239+
---
240+
241+
## Evaluations
242+
243+
Coded agents support evaluations in Studio Web and locally via `uipath eval`. Evaluators cover LLM output quality, tool call correctness, and trajectory analysis.
244+
245+
See the [Evaluations documentation](../eval/index.md) for available evaluators and how to define evaluation sets.
578 KB
Loading
583 KB
Loading
121 KB
Loading
150 KB
Loading
147 KB
Loading

packages/uipath/docs/core/environment_variables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ UIPATH_FOLDER_PATH=/default/path
1717
export UIPATH_FOLDER_PATH=/system/path
1818
```
1919
/// warning
20-
When deploying your agent to production, ensure that all required environment variables (such as API keys and custom configurations) are properly configured in your process settings. This step is crucial for the successful operation of your published package.
20+
When deploying your project to production, ensure that all required environment variables (such as API keys and custom configurations) are properly configured in your process settings. This step is crucial for the successful operation of your published package.
2121
///
2222

2323
## Design
2424

25-
Create a `.env` file in your project's root directory to manage environment variables locally. When using the `uipath auth` or `uipath new my-agent` commands, this file is automatically created.
25+
Create a `.env` file in your project's root directory to manage environment variables locally. When using the `uipath auth` or `uipath new` commands, this file is automatically created.
2626

2727
The `uipath auth` command automatically populates this file with essential variables:
2828

0 commit comments

Comments
 (0)