uipath 2.1.86__py3-none-any.whl → 2.1.88__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of uipath might be problematic. Click here for more details.
- uipath/_cli/__init__.py +2 -2
- uipath/_cli/_utils/_common.py +8 -0
- uipath/_cli/_utils/_input_args.py +22 -3
- uipath/_cli/cli_init.py +20 -15
- uipath/_resources/AGENTS.md +27 -712
- uipath/_resources/CLAUDE.md +1 -0
- uipath/_resources/CLI_REFERENCE.md +219 -0
- uipath/_resources/REQUIRED_STRUCTURE.md +93 -0
- uipath/_resources/SDK_REFERENCE.md +414 -0
- {uipath-2.1.86.dist-info → uipath-2.1.88.dist-info}/METADATA +1 -1
- {uipath-2.1.86.dist-info → uipath-2.1.88.dist-info}/RECORD +14 -10
- {uipath-2.1.86.dist-info → uipath-2.1.88.dist-info}/WHEEL +0 -0
- {uipath-2.1.86.dist-info → uipath-2.1.88.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.86.dist-info → uipath-2.1.88.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -0,0 +1,219 @@
|
|
|
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:** Create uipath.json with input/output schemas and bindings.
|
|
18
|
+
|
|
19
|
+
**Arguments:**
|
|
20
|
+
|
|
21
|
+
| Argument | Required | Description |
|
|
22
|
+
|----------|----------|-------------|
|
|
23
|
+
| `entrypoint` | No | N/A |
|
|
24
|
+
|
|
25
|
+
**Options:**
|
|
26
|
+
|
|
27
|
+
| Option | Type | Default | Description |
|
|
28
|
+
|--------|------|---------|-------------|
|
|
29
|
+
| `--infer-bindings` | flag | false | Infer bindings from the script. |
|
|
30
|
+
|
|
31
|
+
**Usage Examples:**
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Initialize a new agent project
|
|
35
|
+
uv run uipath init
|
|
36
|
+
|
|
37
|
+
# Initialize with specific entrypoint
|
|
38
|
+
uv run uipath init main.py
|
|
39
|
+
|
|
40
|
+
# Initialize and infer bindings from code
|
|
41
|
+
uv run uipath init --infer-bindings
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**When to use:** Run this command when you've modified the Input/Output models and need to regenerate the `uipath.json` schema file.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### `uipath run`
|
|
49
|
+
|
|
50
|
+
**Description:** Execute the project.
|
|
51
|
+
|
|
52
|
+
**Arguments:**
|
|
53
|
+
|
|
54
|
+
| Argument | Required | Description |
|
|
55
|
+
|----------|----------|-------------|
|
|
56
|
+
| `entrypoint` | No | N/A |
|
|
57
|
+
| `input` | No | N/A |
|
|
58
|
+
|
|
59
|
+
**Options:**
|
|
60
|
+
|
|
61
|
+
| Option | Type | Default | Description |
|
|
62
|
+
|--------|------|---------|-------------|
|
|
63
|
+
| `--resume` | flag | false | Resume execution from a previous state |
|
|
64
|
+
| `-f`, `--file` | value | none | File path for the .json input |
|
|
65
|
+
| `--input-file` | value | none | Alias for '-f/--file' arguments |
|
|
66
|
+
| `--output-file` | value | none | File path where the output will be written |
|
|
67
|
+
| `--debug` | flag | false | Enable debugging with debugpy. The process will wait for a debugger to attach. |
|
|
68
|
+
| `--debug-port` | value | `5678` | Port for the debug server (default: 5678) |
|
|
69
|
+
|
|
70
|
+
**Usage Examples:**
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Run agent with inline JSON input
|
|
74
|
+
uv run uipath run main.py '{"query": "What is the weather?"}'
|
|
75
|
+
|
|
76
|
+
# Run agent with input from file
|
|
77
|
+
uv run uipath run main.py --file input.json
|
|
78
|
+
|
|
79
|
+
# Run agent and save output to file
|
|
80
|
+
uv run uipath run agent '{"task": "Process data"}' --output-file result.json
|
|
81
|
+
|
|
82
|
+
# Run agent with debugging enabled
|
|
83
|
+
uv run uipath run main.py '{"input": "test"}' --debug --debug-port 5678
|
|
84
|
+
|
|
85
|
+
# Resume agent execution from previous state
|
|
86
|
+
uv run uipath run --resume
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**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.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### `uipath eval`
|
|
94
|
+
|
|
95
|
+
**Description:** Run an evaluation set against the agent.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
entrypoint: Path to the agent script to evaluate (optional, will auto-discover if not specified)
|
|
99
|
+
eval_set: Path to the evaluation set JSON file (optional, will auto-discover if not specified)
|
|
100
|
+
eval_ids: Optional list of evaluation IDs
|
|
101
|
+
workers: Number of parallel workers for running evaluations
|
|
102
|
+
no_report: Do not report the evaluation results
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
**Arguments:**
|
|
106
|
+
|
|
107
|
+
| Argument | Required | Description |
|
|
108
|
+
|----------|----------|-------------|
|
|
109
|
+
| `entrypoint` | No | N/A |
|
|
110
|
+
| `eval_set` | No | N/A |
|
|
111
|
+
|
|
112
|
+
**Options:**
|
|
113
|
+
|
|
114
|
+
| Option | Type | Default | Description |
|
|
115
|
+
|--------|------|---------|-------------|
|
|
116
|
+
| `--no-report` | flag | false | Do not report the evaluation results |
|
|
117
|
+
| `--workers` | value | `1` | Number of parallel workers for running evaluations (default: 1) |
|
|
118
|
+
| `--output-file` | value | none | File path where the output will be written |
|
|
119
|
+
|
|
120
|
+
**Usage Examples:**
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Run evaluation with auto-discovered files
|
|
124
|
+
uv run uipath eval
|
|
125
|
+
|
|
126
|
+
# Run evaluation with specific entrypoint and eval set
|
|
127
|
+
uv run uipath eval main.py eval_set.json
|
|
128
|
+
|
|
129
|
+
# Run evaluation without reporting results
|
|
130
|
+
uv run uipath eval --no-report
|
|
131
|
+
|
|
132
|
+
# Run evaluation with custom number of workers
|
|
133
|
+
uv run uipath eval --workers 4
|
|
134
|
+
|
|
135
|
+
# Save evaluation output to file
|
|
136
|
+
uv run uipath eval --output-file eval_results.json
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**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.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Common Workflows
|
|
144
|
+
|
|
145
|
+
**1. Creating a New Agent:**
|
|
146
|
+
```bash
|
|
147
|
+
# Step 1: Initialize project
|
|
148
|
+
uv run uipath init
|
|
149
|
+
|
|
150
|
+
# Step 2: Run agent to test
|
|
151
|
+
uv run uipath run main.py '{"input": "test"}'
|
|
152
|
+
|
|
153
|
+
# Step 3: Evaluate agent performance
|
|
154
|
+
uv run uipath eval
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**2. Development & Testing:**
|
|
158
|
+
```bash
|
|
159
|
+
# Run with debugging
|
|
160
|
+
uv run uipath run main.py '{"input": "test"}' --debug
|
|
161
|
+
|
|
162
|
+
# Test with input file
|
|
163
|
+
uv run uipath run main.py --file test_input.json --output-file test_output.json
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**3. Schema Updates:**
|
|
167
|
+
```bash
|
|
168
|
+
# After modifying Input/Output models, regenerate schema
|
|
169
|
+
uv run uipath init --infer-bindings
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Configuration File (uipath.json)
|
|
173
|
+
|
|
174
|
+
The `uipath.json` file is automatically generated by `uipath init` and defines your agent's schema and bindings.
|
|
175
|
+
|
|
176
|
+
**Structure:**
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"entryPoints": [
|
|
181
|
+
{
|
|
182
|
+
"filePath": "agent",
|
|
183
|
+
"uniqueId": "uuid-here",
|
|
184
|
+
"type": "agent",
|
|
185
|
+
"input": {
|
|
186
|
+
"type": "object",
|
|
187
|
+
"properties": { ... },
|
|
188
|
+
"description": "Input schema",
|
|
189
|
+
"required": [ ... ]
|
|
190
|
+
},
|
|
191
|
+
"output": {
|
|
192
|
+
"type": "object",
|
|
193
|
+
"properties": { ... },
|
|
194
|
+
"description": "Output schema",
|
|
195
|
+
"required": [ ... ]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"bindings": {
|
|
200
|
+
"version": "2.0",
|
|
201
|
+
"resources": []
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**When to Update:**
|
|
207
|
+
|
|
208
|
+
1. **After Modifying Input/Output Models**: Run `uv run uipath init --infer-bindings` to regenerate schemas
|
|
209
|
+
2. **Changing Entry Point**: Update `filePath` if you rename or move your main file
|
|
210
|
+
3. **Manual Schema Adjustments**: Edit `input.jsonSchema` or `output.jsonSchema` directly if needed
|
|
211
|
+
4. **Bindings Updates**: The `bindings` section maps the exported graph variable - update if you rename your graph
|
|
212
|
+
|
|
213
|
+
**Important Notes:**
|
|
214
|
+
|
|
215
|
+
- The `uniqueId` should remain constant for the same agent
|
|
216
|
+
- Always use `type: "agent"` for LangGraph agents
|
|
217
|
+
- The `jsonSchema` must match your Pydantic models exactly
|
|
218
|
+
- Re-run `uipath init --infer-bindings` instead of manual edits when possible
|
|
219
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
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 three 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 State(BaseModel):
|
|
18
|
+
"""Define the agent's internal state that flows between nodes"""
|
|
19
|
+
# Add your state fields here
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
class Output(BaseModel):
|
|
23
|
+
"""Define output fields that the agent returns"""
|
|
24
|
+
# Add your output fields here
|
|
25
|
+
pass
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Required LLM Initialization
|
|
29
|
+
|
|
30
|
+
Unless the user explicitly requests a different LLM provider, always use `UiPathChat`:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from uipath_langchain.chat import UiPathChat
|
|
34
|
+
|
|
35
|
+
llm = UiPathChat(model="gpt-4o-2024-08-06", temperature=0.7)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Alternative LLMs** (only use if explicitly requested):
|
|
39
|
+
- `ChatOpenAI` from `langchain_openai`
|
|
40
|
+
- `ChatAnthropic` from `langchain_anthropic`
|
|
41
|
+
- Other LangChain-compatible LLMs
|
|
42
|
+
|
|
43
|
+
### Standard Agent Template
|
|
44
|
+
|
|
45
|
+
Every agent should follow this basic structure:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from langchain_core.messages import SystemMessage, HumanMessage
|
|
49
|
+
from langgraph.graph import START, StateGraph, END
|
|
50
|
+
from uipath_langchain.chat import UiPathChat
|
|
51
|
+
from pydantic import BaseModel
|
|
52
|
+
|
|
53
|
+
# 1. Define Input, State, and Output models
|
|
54
|
+
class Input(BaseModel):
|
|
55
|
+
field: str
|
|
56
|
+
|
|
57
|
+
class State(BaseModel):
|
|
58
|
+
field: str
|
|
59
|
+
result: str = ""
|
|
60
|
+
|
|
61
|
+
class Output(BaseModel):
|
|
62
|
+
result: str
|
|
63
|
+
|
|
64
|
+
# 2. Initialize UiPathChat LLM
|
|
65
|
+
llm = UiPathChat(model="gpt-4o-2024-08-06", temperature=0.7)
|
|
66
|
+
|
|
67
|
+
# 3. Define agent nodes (async functions)
|
|
68
|
+
async def process_node(state: State) -> State:
|
|
69
|
+
response = await llm.ainvoke([HumanMessage(state.field)])
|
|
70
|
+
return State(field=state.field, result=response.content)
|
|
71
|
+
|
|
72
|
+
async def output_node(state: State) -> Output:
|
|
73
|
+
return Output(result=state.result)
|
|
74
|
+
|
|
75
|
+
# 4. Build the graph
|
|
76
|
+
builder = StateGraph(State, input=Input, output=Output)
|
|
77
|
+
builder.add_node("process", process_node)
|
|
78
|
+
builder.add_node("output", output_node)
|
|
79
|
+
builder.add_edge(START, "process")
|
|
80
|
+
builder.add_edge("process", "output")
|
|
81
|
+
builder.add_edge("output", END)
|
|
82
|
+
|
|
83
|
+
# 5. Compile the graph
|
|
84
|
+
graph = builder.compile()
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Key Rules**:
|
|
88
|
+
1. Always use async/await for all node functions
|
|
89
|
+
2. All nodes (except output) must accept and return `State`
|
|
90
|
+
3. The final output node must return `Output`
|
|
91
|
+
4. Use `StateGraph(State, input=Input, output=Output)` for initialization
|
|
92
|
+
5. Always compile with `graph = builder.compile()`
|
|
93
|
+
|