Skip to content

Commit e7485f4

Browse files
committed
misc: update runtime
1 parent 55f5c02 commit e7485f4

24 files changed

Lines changed: 4423 additions & 14 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"message": "une blague."
2+
"message": "Tell me a joke"
33
}
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
## CLI Commands Reference
2+
3+
The UiPath Python SDK provides a comprehensive CLI for managing coded agents and automation projects. All commands should be executed with `uv run uipath <command>`.
4+
5+
### Command Overview
6+
7+
| Command | Purpose | When to Use |
8+
|---------|---------|-------------|
9+
| `init` | Initialize agent project | Creating a new agent or updating schema |
10+
| `run` | Execute agent | Running agent locally or testing |
11+
| `eval` | Evaluate agent | Testing agent performance with evaluation sets |
12+
13+
---
14+
15+
### `uipath init`
16+
17+
**Description:** Initialize the project.
18+
19+
**Options:**
20+
21+
| Option | Type | Default | Description |
22+
|--------|------|---------|-------------|
23+
| `--no-agents-md-override` | flag | false | Won't override existing .agent files and AGENTS.md file. |
24+
25+
**Usage Examples:**
26+
27+
```bash
28+
# Initialize a new agent project
29+
uv run uipath init
30+
31+
# Initialize with specific entrypoint
32+
uv run uipath init main.py
33+
34+
# Initialize and infer bindings from code
35+
uv run uipath init --infer-bindings
36+
```
37+
38+
**When to use:** Run this command when you've modified the Input/Output models and need to regenerate the `uipath.json` schema file.
39+
40+
---
41+
42+
### `uipath run`
43+
44+
**Description:** Execute the project.
45+
46+
**Arguments:**
47+
48+
| Argument | Required | Description |
49+
|----------|----------|-------------|
50+
| `entrypoint` | No | N/A |
51+
| `input` | No | N/A |
52+
53+
**Options:**
54+
55+
| Option | Type | Default | Description |
56+
|--------|------|---------|-------------|
57+
| `--resume` | flag | false | Resume execution from a previous state |
58+
| `-f`, `--file` | value | `Sentinel.UNSET` | File path for the .json input |
59+
| `--input-file` | value | `Sentinel.UNSET` | Alias for '-f/--file' arguments |
60+
| `--output-file` | value | `Sentinel.UNSET` | File path where the output will be written |
61+
| `--trace-file` | value | `Sentinel.UNSET` | File path where the trace spans will be written (JSON Lines format) |
62+
| `--debug` | flag | false | Enable debugging with debugpy. The process will wait for a debugger to attach. |
63+
| `--debug-port` | value | `5678` | Port for the debug server (default: 5678) |
64+
65+
**Usage Examples:**
66+
67+
```bash
68+
# Run agent with inline JSON input
69+
uv run uipath run main.py '{"query": "What is the weather?"}'
70+
71+
# Run agent with input from file
72+
uv run uipath run main.py --file input.json
73+
74+
# Run agent and save output to file
75+
uv run uipath run agent '{"task": "Process data"}' --output-file result.json
76+
77+
# Run agent with debugging enabled
78+
uv run uipath run main.py '{"input": "test"}' --debug --debug-port 5678
79+
80+
# Resume agent execution from previous state
81+
uv run uipath run --resume
82+
```
83+
84+
**When to use:** Run this command to execute your agent locally for development, testing, or debugging. Use `--debug` flag to attach a debugger for step-by-step debugging.
85+
86+
---
87+
88+
### `uipath eval`
89+
90+
**Description:** Run an evaluation set against the agent.
91+
92+
Args:
93+
entrypoint: Path to the agent script to evaluate (optional, will auto-discover if not specified)
94+
eval_set: Path to the evaluation set JSON file (optional, will auto-discover if not specified)
95+
eval_ids: Optional list of evaluation IDs
96+
eval_set_run_id: Custom evaluation set run ID (optional, will generate UUID if not specified)
97+
workers: Number of parallel workers for running evaluations
98+
no_report: Do not report the evaluation results
99+
enable_mocker_cache: Enable caching for LLM mocker responses
100+
report_coverage: Report evaluation coverage
101+
model_settings_id: Model settings ID to override agent settings
102+
trace_file: File path where traces will be written in JSONL format
103+
max_llm_concurrency: Maximum concurrent LLM requests
104+
input_overrides: Input field overrides mapping (direct field override with deep merge)
105+
106+
107+
**Arguments:**
108+
109+
| Argument | Required | Description |
110+
|----------|----------|-------------|
111+
| `entrypoint` | No | N/A |
112+
| `eval_set` | No | N/A |
113+
114+
**Options:**
115+
116+
| Option | Type | Default | Description |
117+
|--------|------|---------|-------------|
118+
| `--eval-set-run-id` | value | `Sentinel.UNSET` | Custom evaluation set run ID (if not provided, a UUID will be generated) |
119+
| `--no-report` | flag | false | Do not report the evaluation results |
120+
| `--workers` | value | `1` | Number of parallel workers for running evaluations (default: 1) |
121+
| `--output-file` | value | `Sentinel.UNSET` | File path where the output will be written |
122+
| `--enable-mocker-cache` | flag | false | Enable caching for LLM mocker responses |
123+
| `--report-coverage` | flag | false | Report evaluation coverage |
124+
| `--model-settings-id` | value | `"default"` | Model settings ID from evaluation set to override agent settings (default: 'default') |
125+
| `--trace-file` | value | `Sentinel.UNSET` | File path where traces will be written in JSONL format |
126+
| `--max-llm-concurrency` | value | `20` | Maximum concurrent LLM requests (default: 20) |
127+
128+
**Usage Examples:**
129+
130+
```bash
131+
# Run evaluation with auto-discovered files
132+
uv run uipath eval
133+
134+
# Run evaluation with specific entrypoint and eval set
135+
uv run uipath eval main.py eval_set.json
136+
137+
# Run evaluation without reporting results
138+
uv run uipath eval --no-report
139+
140+
# Run evaluation with custom number of workers
141+
uv run uipath eval --workers 4
142+
143+
# Save evaluation output to file
144+
uv run uipath eval --output-file eval_results.json
145+
```
146+
147+
**When to use:** Run this command to test your agent's performance against a predefined evaluation set. This helps validate agent behavior and measure quality metrics.
148+
149+
---
150+
151+
### Common Workflows
152+
153+
**1. Creating a New Agent:**
154+
```bash
155+
# Step 1: Initialize project
156+
uv run uipath init
157+
158+
# Step 2: Run agent to test
159+
uv run uipath run main.py '{"input": "test"}'
160+
161+
# Step 3: Evaluate agent performance
162+
uv run uipath eval
163+
```
164+
165+
**2. Development & Testing:**
166+
```bash
167+
# Run with debugging
168+
uv run uipath run main.py '{"input": "test"}' --debug
169+
170+
# Test with input file
171+
uv run uipath run main.py --file test_input.json --output-file test_output.json
172+
```
173+
174+
**3. Schema Updates:**
175+
```bash
176+
# After modifying Input/Output models, regenerate schema
177+
uv run uipath init --infer-bindings
178+
```
179+
180+
### Configuration File (uipath.json)
181+
182+
The `uipath.json` file is automatically generated by `uipath init` and defines your agent's schema and bindings.
183+
184+
**Structure:**
185+
186+
```json
187+
{
188+
"entryPoints": [
189+
{
190+
"filePath": "agent",
191+
"uniqueId": "uuid-here",
192+
"type": "agent",
193+
"input": {
194+
"type": "object",
195+
"properties": { ... },
196+
"description": "Input schema",
197+
"required": [ ... ]
198+
},
199+
"output": {
200+
"type": "object",
201+
"properties": { ... },
202+
"description": "Output schema",
203+
"required": [ ... ]
204+
}
205+
}
206+
],
207+
"bindings": {
208+
"version": "2.0",
209+
"resources": []
210+
}
211+
}
212+
```
213+
214+
**When to Update:**
215+
216+
1. **After Modifying Input/Output Models**: Run `uv run uipath init --infer-bindings` to regenerate schemas
217+
2. **Changing Entry Point**: Update `filePath` if you rename or move your main file
218+
3. **Manual Schema Adjustments**: Edit `input.jsonSchema` or `output.jsonSchema` directly if needed
219+
4. **Bindings Updates**: The `bindings` section maps the exported graph variable - update if you rename your graph
220+
221+
**Important Notes:**
222+
223+
- The `uniqueId` should remain constant for the same agent
224+
- Always use `type: "agent"` for LangGraph agents
225+
- The `jsonSchema` must match your Pydantic models exactly
226+
- Re-run `uipath init --infer-bindings` instead of manual edits when possible
227+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
## Required Agent Structure
2+
3+
**IMPORTANT**: All UiPath coded agents MUST follow this standard structure unless explicitly specified otherwise by the user.
4+
5+
### Required Components
6+
7+
Every agent implementation MUST include these two Pydantic models:
8+
9+
```python
10+
from pydantic import BaseModel
11+
12+
class Input(BaseModel):
13+
"""Define input fields that the agent accepts"""
14+
# Add your input fields here
15+
pass
16+
17+
class Output(BaseModel):
18+
"""Define output fields that the agent returns"""
19+
# Add your output fields here
20+
pass
21+
```
22+
23+
### SDK Initialization
24+
25+
```python
26+
from uipath.platform import UiPath
27+
28+
# Initialize with environment variables
29+
uipath = UiPath()
30+
31+
# With explicit credentials
32+
uipath = UiPath(base_url="https://cloud.uipath.com/...", secret="your_token")
33+
34+
# Or with client_id and client_secret
35+
uipath = UiPath(
36+
client_id=UIPATH_CLIENT_ID,
37+
client_secret=UIPATH_CLIENT_SECRET,
38+
scope=UIPATH_SCOPE,
39+
base_url=UIPATH_URL
40+
)
41+
```
42+
43+
### Standard Agent Template
44+
45+
Every agent should follow this basic structure:
46+
47+
```python
48+
from uipath.platform import UiPath
49+
from pydantic import BaseModel
50+
51+
# 1. Define Input, and Output models
52+
class Input(BaseModel):
53+
field: str
54+
55+
class Output(BaseModel):
56+
result: str
57+
58+
# 2. Initialize with environment variables
59+
uipath = UiPath()
60+
61+
# 3. Define the main function (the main function can be named "main", "run" or "execute")
62+
def main(input_data: Input) -> Output:
63+
pass
64+
```

0 commit comments

Comments
 (0)