uipath 2.1.89__py3-none-any.whl → 2.1.90__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/cli_init.py +26 -12
- uipath/_resources/AGENTS.md +2 -20
- uipath/_resources/REQUIRED_STRUCTURE.md +23 -52
- uipath/_resources/SDK_REFERENCE.md +1 -1
- {uipath-2.1.89.dist-info → uipath-2.1.90.dist-info}/METADATA +1 -1
- {uipath-2.1.89.dist-info → uipath-2.1.90.dist-info}/RECORD +9 -9
- {uipath-2.1.89.dist-info → uipath-2.1.90.dist-info}/WHEEL +0 -0
- {uipath-2.1.89.dist-info → uipath-2.1.90.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.89.dist-info → uipath-2.1.90.dist-info}/licenses/LICENSE +0 -0
uipath/_cli/cli_init.py
CHANGED
|
@@ -60,20 +60,17 @@ def generate_env_file(target_directory):
|
|
|
60
60
|
console.success(f"Created '{relative_path}' file.")
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
def
|
|
63
|
+
def generate_agent_md_file(target_directory: str, file_name: str) -> None:
|
|
64
64
|
"""Generate an agent-specific file from the packaged resource.
|
|
65
65
|
|
|
66
66
|
Args:
|
|
67
67
|
target_directory: The directory where the file should be created.
|
|
68
68
|
file_name: The name of the file should be created.
|
|
69
69
|
"""
|
|
70
|
-
|
|
71
|
-
os.makedirs(agent_dir, exist_ok=True)
|
|
72
|
-
|
|
73
|
-
target_path = os.path.join(agent_dir, file_name)
|
|
70
|
+
target_path = os.path.join(target_directory, file_name)
|
|
74
71
|
|
|
75
72
|
if os.path.exists(target_path):
|
|
76
|
-
logger.debug(f"File '
|
|
73
|
+
logger.debug(f"File '{target_path}' already exists.")
|
|
77
74
|
return
|
|
78
75
|
|
|
79
76
|
try:
|
|
@@ -82,11 +79,32 @@ def generate_agent_specific_file_md(target_directory: str, file_name: str) -> No
|
|
|
82
79
|
with importlib.resources.as_file(source_path) as s_path:
|
|
83
80
|
shutil.copy(s_path, target_path)
|
|
84
81
|
|
|
85
|
-
console.success(f"Created '{f'.agent/{file_name}'}' file.")
|
|
86
82
|
except Exception as e:
|
|
87
83
|
console.warning(f"Could not create {file_name}: {e}")
|
|
88
84
|
|
|
89
85
|
|
|
86
|
+
def generate_agent_md_files(target_directory: str) -> None:
|
|
87
|
+
"""Generate an agent-specific file from the packaged resource.
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
target_directory: The directory where the files should be created.
|
|
91
|
+
"""
|
|
92
|
+
agent_dir = os.path.join(target_directory, ".agent")
|
|
93
|
+
os.makedirs(agent_dir, exist_ok=True)
|
|
94
|
+
|
|
95
|
+
root_files = ["AGENTS.md", "CLAUDE.md"]
|
|
96
|
+
|
|
97
|
+
agent_files = ["CLI_REFERENCE.md", "REQUIRED_STRUCTURE.md", "SDK_REFERENCE.md"]
|
|
98
|
+
|
|
99
|
+
for file_name in root_files:
|
|
100
|
+
generate_agent_md_file(target_directory, file_name)
|
|
101
|
+
|
|
102
|
+
for file_name in agent_files:
|
|
103
|
+
generate_agent_md_file(agent_dir, file_name)
|
|
104
|
+
|
|
105
|
+
console.success(f"Created {click.style('AGENTS.md', fg='cyan')} file.")
|
|
106
|
+
|
|
107
|
+
|
|
90
108
|
def get_existing_settings(config_path: str) -> Optional[Dict[str, Any]]:
|
|
91
109
|
"""Read existing settings from uipath.json if it exists.
|
|
92
110
|
|
|
@@ -161,11 +179,6 @@ def init(entrypoint: str, infer_bindings: bool) -> None:
|
|
|
161
179
|
current_directory = os.getcwd()
|
|
162
180
|
generate_env_file(current_directory)
|
|
163
181
|
create_telemetry_config_file(current_directory)
|
|
164
|
-
generate_agent_specific_file_md(current_directory, "AGENTS.md")
|
|
165
|
-
generate_agent_specific_file_md(current_directory, "CLI_REFERENCE.md")
|
|
166
|
-
generate_agent_specific_file_md(current_directory, "REQUIRED_STRUCTURE.md")
|
|
167
|
-
generate_agent_specific_file_md(current_directory, "SDK_REFERENCE.md")
|
|
168
|
-
generate_agent_specific_file_md(current_directory, "CLAUDE.md")
|
|
169
182
|
|
|
170
183
|
result = Middlewares.next(
|
|
171
184
|
"init",
|
|
@@ -185,6 +198,7 @@ def init(entrypoint: str, infer_bindings: bool) -> None:
|
|
|
185
198
|
if not result.should_continue:
|
|
186
199
|
return
|
|
187
200
|
|
|
201
|
+
generate_agent_md_files(current_directory)
|
|
188
202
|
script_path = get_user_script(current_directory, entrypoint=entrypoint)
|
|
189
203
|
|
|
190
204
|
if not script_path:
|
uipath/_resources/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Code Patterns Reference
|
|
2
2
|
|
|
3
|
-
This document provides practical code patterns for building UiPath coded agents using
|
|
3
|
+
This document provides practical code patterns for building UiPath coded agents using the UiPath Python SDK.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,32 +8,14 @@ This document provides practical code patterns for building UiPath coded agents
|
|
|
8
8
|
|
|
9
9
|
This documentation is split into multiple files for efficient context loading. Load only the files you need:
|
|
10
10
|
|
|
11
|
-
### Core Documentation Files
|
|
12
|
-
|
|
13
11
|
1. **@.agent/REQUIRED_STRUCTURE.md** - Agent structure patterns and templates
|
|
14
12
|
- **When to load:** Creating a new agent or understanding required patterns
|
|
15
|
-
- **Contains:** Required Pydantic models (Input,
|
|
16
|
-
- **Size:** ~90 lines
|
|
13
|
+
- **Contains:** Required Pydantic models (Input, Output), SDK initialization patterns, standard agent template
|
|
17
14
|
|
|
18
15
|
2. **@.agent/SDK_REFERENCE.md** - Complete SDK API reference
|
|
19
16
|
- **When to load:** Calling UiPath SDK methods, working with services (actions, assets, jobs, etc.)
|
|
20
17
|
- **Contains:** All SDK services and methods with full signatures and type annotations
|
|
21
|
-
- **Size:** ~400 lines
|
|
22
18
|
|
|
23
19
|
3. **@.agent/CLI_REFERENCE.md** - CLI commands documentation
|
|
24
20
|
- **When to load:** Working with `uipath init`, `uipath run`, or `uipath eval` commands
|
|
25
21
|
- **Contains:** Command syntax, options, usage examples, and workflows
|
|
26
|
-
- **Size:** ~200 lines
|
|
27
|
-
|
|
28
|
-
### Usage Guidelines
|
|
29
|
-
|
|
30
|
-
**For LLMs:**
|
|
31
|
-
- Read this file (AGENTS.md) first to understand the documentation structure
|
|
32
|
-
- Load .agent/REQUIRED_STRUCTURE.md when building new agents or need structure reference
|
|
33
|
-
- Load .agent/SDK_REFERENCE.md only when you need to call specific SDK methods
|
|
34
|
-
- Load .agent/CLI_REFERENCE.md only when working with CLI commands
|
|
35
|
-
|
|
36
|
-
**Benefits:**
|
|
37
|
-
- Reduced token usage by loading only relevant context
|
|
38
|
-
- Faster response times
|
|
39
|
-
- More focused context for specific tasks
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
### Required Components
|
|
6
6
|
|
|
7
|
-
Every agent implementation MUST include these
|
|
7
|
+
Every agent implementation MUST include these two Pydantic models:
|
|
8
8
|
|
|
9
9
|
```python
|
|
10
10
|
from pydantic import BaseModel
|
|
@@ -14,80 +14,51 @@ class Input(BaseModel):
|
|
|
14
14
|
# Add your input fields here
|
|
15
15
|
pass
|
|
16
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
17
|
class Output(BaseModel):
|
|
23
18
|
"""Define output fields that the agent returns"""
|
|
24
19
|
# Add your output fields here
|
|
25
20
|
pass
|
|
26
21
|
```
|
|
27
22
|
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
Unless the user explicitly requests a different LLM provider, always use `UiPathChat`:
|
|
23
|
+
### SDK Initialization
|
|
31
24
|
|
|
32
25
|
```python
|
|
33
|
-
from
|
|
26
|
+
from uipath import UiPath
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
# Initialize with environment variables
|
|
29
|
+
uipath = UiPath()
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
42
|
|
|
43
43
|
### Standard Agent Template
|
|
44
44
|
|
|
45
45
|
Every agent should follow this basic structure:
|
|
46
46
|
|
|
47
47
|
```python
|
|
48
|
-
from
|
|
49
|
-
from langgraph.graph import START, StateGraph, END
|
|
50
|
-
from uipath_langchain.chat import UiPathChat
|
|
48
|
+
from uipath import UiPath
|
|
51
49
|
from pydantic import BaseModel
|
|
52
50
|
|
|
53
|
-
# 1. Define Input,
|
|
51
|
+
# 1. Define Input, and Output models
|
|
54
52
|
class Input(BaseModel):
|
|
55
53
|
field: str
|
|
56
54
|
|
|
57
|
-
class State(BaseModel):
|
|
58
|
-
field: str
|
|
59
|
-
result: str = ""
|
|
60
|
-
|
|
61
55
|
class Output(BaseModel):
|
|
62
56
|
result: str
|
|
63
57
|
|
|
64
|
-
# 2. Initialize
|
|
65
|
-
|
|
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)
|
|
58
|
+
# 2. Initialize with environment variables
|
|
59
|
+
uipath = UiPath()
|
|
74
60
|
|
|
75
|
-
#
|
|
76
|
-
|
|
77
|
-
|
|
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()
|
|
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
|
|
85
64
|
```
|
|
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
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.90
|
|
4
4
|
Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
|
|
5
5
|
Project-URL: Homepage, https://uipath.com
|
|
6
6
|
Project-URL: Repository, https://github.com/UiPath/uipath-python
|
|
@@ -10,7 +10,7 @@ uipath/_cli/cli_auth.py,sha256=CzetSRqSUvMs02PtI4w5Vi_0fv_ETA307bB2vXalWzY,2628
|
|
|
10
10
|
uipath/_cli/cli_deploy.py,sha256=KPCmQ0c_NYD5JofSDao5r6QYxHshVCRxlWDVnQvlp5w,645
|
|
11
11
|
uipath/_cli/cli_dev.py,sha256=nEfpjw1PZ72O6jmufYWVrueVwihFxDPOeJakdvNHdOA,2146
|
|
12
12
|
uipath/_cli/cli_eval.py,sha256=oOMywGSUrHDQ1W_54ccbekzCeduPf-KHRyu_r0Dezd0,5444
|
|
13
|
-
uipath/_cli/cli_init.py,sha256=
|
|
13
|
+
uipath/_cli/cli_init.py,sha256=AUBQxUO1LWC2W-MaydkJBlhsg1m-H7eiXqu5jNhTgPQ,7673
|
|
14
14
|
uipath/_cli/cli_invoke.py,sha256=m-te-EjhDpk_fhFDkt-yQFzmjEHGo5lQDGEQWxSXisQ,4395
|
|
15
15
|
uipath/_cli/cli_new.py,sha256=9378NYUBc9j-qKVXV7oja-jahfJhXBg8zKVyaon7ctY,2102
|
|
16
16
|
uipath/_cli/cli_pack.py,sha256=NmwZTfwZ2fURiHyiX1BM0juAtBOjPB1Jmcpu-rD7p-4,11025
|
|
@@ -90,11 +90,11 @@ uipath/_cli/_utils/_uv_helpers.py,sha256=6SvoLnZPoKIxW0sjMvD1-ENV_HOXDYzH34GjBqw
|
|
|
90
90
|
uipath/_events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
91
91
|
uipath/_events/_event_bus.py,sha256=4-VzstyX69cr7wT1EY7ywp-Ndyz2CyemD3Wk_-QmRpo,5496
|
|
92
92
|
uipath/_events/_events.py,sha256=EzDfzpVm-EIH27Onad5mo8Go6-WB3S6_-6zZQ7qV58w,1811
|
|
93
|
-
uipath/_resources/AGENTS.md,sha256=
|
|
93
|
+
uipath/_resources/AGENTS.md,sha256=nRQNAVeEBaBvuMzXw8uXtMnGebLClUgwIMlgb8_qU9o,1039
|
|
94
94
|
uipath/_resources/CLAUDE.md,sha256=kYsckFWTVe948z_fNWLysCHvi9_YpchBXl3s1Ek03lU,10
|
|
95
95
|
uipath/_resources/CLI_REFERENCE.md,sha256=stB6W2aUr0o9UzZ49h7ZXvltaLhnwPUe4_erko4Nr9k,6262
|
|
96
|
-
uipath/_resources/REQUIRED_STRUCTURE.md,sha256=
|
|
97
|
-
uipath/_resources/SDK_REFERENCE.md,sha256=
|
|
96
|
+
uipath/_resources/REQUIRED_STRUCTURE.md,sha256=3laqGiNa3kauJ7jRI1d7w_fWKUDkqYBjcTT_6_8FAGk,1417
|
|
97
|
+
uipath/_resources/SDK_REFERENCE.md,sha256=4wX8a1W5EJCta-iEHy_cDRahn0ENpJykwn-w4k_Lh6s,23245
|
|
98
98
|
uipath/_services/__init__.py,sha256=_LNy4u--VlhVtTO66bULbCoBjyJBTuyh9jnzjWrv-h4,1140
|
|
99
99
|
uipath/_services/_base_service.py,sha256=x9-9jhPzn9Z16KRdFHhJNvV-FZHvTniMsDfxlS4Cutk,5782
|
|
100
100
|
uipath/_services/actions_service.py,sha256=2RPMR-hFMsOlqEyjIf3aF7-lrf57jdrSD0pBjj0Kyko,16040
|
|
@@ -181,8 +181,8 @@ uipath/tracing/_utils.py,sha256=X-LFsyIxDeNOGuHPvkb6T5o9Y8ElYhr_rP3CEBJSu4s,1383
|
|
|
181
181
|
uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
|
|
182
182
|
uipath/utils/_endpoints_manager.py,sha256=iRTl5Q0XAm_YgcnMcJOXtj-8052sr6jpWuPNz6CgT0Q,8408
|
|
183
183
|
uipath/utils/dynamic_schema.py,sha256=w0u_54MoeIAB-mf3GmwX1A_X8_HDrRy6p998PvX9evY,3839
|
|
184
|
-
uipath-2.1.
|
|
185
|
-
uipath-2.1.
|
|
186
|
-
uipath-2.1.
|
|
187
|
-
uipath-2.1.
|
|
188
|
-
uipath-2.1.
|
|
184
|
+
uipath-2.1.90.dist-info/METADATA,sha256=GUdxOQ8RiDFdvNtyRByMvvA_q_Ionidg7VbtOEKzdQg,6593
|
|
185
|
+
uipath-2.1.90.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
186
|
+
uipath-2.1.90.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
|
187
|
+
uipath-2.1.90.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
|
188
|
+
uipath-2.1.90.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|