You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Most of the times when working on this repo, you'll also need to do some changes
4
4
5
5
## Development Strategies
6
6
7
-
A simple way to make development easier and not combine code changes with agent defintitions, is to create a separate Python project that references the `uipath-agents-python` package as an editable dependency. For a better experience, start by creating a new root-level directory (e.g. `python-workspace`) that will hold all the related projects and repositories.
7
+
A simple way to make development easier and not combine code changes with agent definitions, is to create a separate Python project that references the `uipath-agents-python` package as an editable dependency. For a better experience, start by creating a new root-level directory (e.g. `python-workspace`) that will hold all the related projects and repositories.
8
8
9
9
```bash
10
10
# . python-workspace/
@@ -43,13 +43,21 @@ You can open this directory in your IDE to make your life easier instead of open
# repeat the instructions to run an agent from [README.md](README.md)
46
+
# Ensure agent.json is at the top level (required for runtime detection)
47
+
ls agent.json
48
+
49
+
# Authenticate and run
47
50
uv run uipath auth --alpha
48
-
uv run uipath agent.json '{}'
51
+
uv run uipath run agent.json '{}'
49
52
```
50
53
51
54
3. You now have a fully functioning setup to start working on `uipath-agents-python`. Any change will be picked up by the `playground` project for testing.
52
55
56
+
**Key behavior to remember:**
57
+
- The runtime automatically detects agents by the presence of `agent.json` at the top level - this MUST be present at all times even if `.agent-builder/` with `agent.json` in already exists.
58
+
- If you create a `.agent-builder/` directory, it would override the top-level `agent.json` and `bindings.json` during execution.
59
+
- Copying contents of .agent-builder runs during both `run` and `debug` commands and files are copied only if the directory exists, without being a critical dependency.
60
+
53
61
### Multiple Repositories
54
62
55
63
Due to how the SDKs are structured, most of the code used for agents in stored in `uipath-langchain-python`. And in order to test the changes locally, you'll also need to set it up as an `editable` dependency. While we're at it, we'll do the same for`uipath-python` to have a complete development environment.
Copy file name to clipboardExpand all lines: README.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,11 +64,15 @@ uv run uipath run
64
64
65
65
The library expects multiple files in order to run:
66
66
67
-
-`agent.json`: agent definition file
67
+
-`agent.json`: agent definition file (also used for Agents runtime detection)
68
68
-`bindings.json`: agent's bindings definiton file
69
69
-`uipath.json`: binding overwrite information
70
70
71
-
These files are generated automatically by Studio Web / Serverless Executor and can be obtained for local development by following these steps:
71
+
These files must be present at the **top level** of your working directory. The UiPath CLI automatically detects which runtime to use based on the presence of `agent.json` - if found, it loads the `AgentsRuntimeFactory` from this package to handle agent execution.
72
+
73
+
#### Getting the Configuration Files
74
+
75
+
These files are generated automatically by Studio Web / Serverless Executor. For local development, you can obtain them by following these steps:
72
76
73
77
1. Open an agent project in Studio Web.
74
78
2. Start a Debug run (you can wait for the agent to finish or stop after a few seconds).
@@ -80,7 +84,7 @@ These files are generated automatically by Studio Web / Serverless Executor and
80
84
81
85
-if a warning with`.agent-builder folder not found` is displayed, run the agent in Debug one more time
82
86
83
-
4. Copy the `agent.json` and `bindings.json` from the output.
87
+
4. Copy the `agent.json` and `bindings.json` from the output to your local project directory.
84
88
5. Create a `uipath.json` file using the following contents:
85
89
86
90
```json
@@ -93,13 +97,15 @@ These files are generated automatically by Studio Web / Serverless Executor and
93
97
}
94
98
```
95
99
100
+
**Note on `.agent-builder` directory**: When running agents locally, the runtime automatically checks for a `.agent-builder/`directory. If it exists, any files inside will be copied to the top level, overriding existing files. This is used by Studio Web, but you can also leverage it for local testing by placing updated configurations in`.agent-builder/` without modifying your main files.
101
+
96
102
### Commands
97
103
98
104
For normal local development, only the `run` command is relevant, as the `debug` command is not meant for local debug, it's intended for Studio Web debug. The `run` command can be used for debugging the python code IDE.
99
105
100
106
**Run**
101
107
102
-
The basic command used to start or resume an agent execution in production mode (source code [cli_run.py](src/uipath_agents/_cli/cli_run.py))
108
+
The basic command used to start or resume an agent execution in production mode (source code [cli_run.py](src/uipath_agents/_cli/cli_run.py)). This command will automatically prepare agent files from `.agent-builder/` if that directory exists before executing.
103
109
104
110
```bash
105
111
# Start the agent.json from the current directory with inline args
@@ -118,24 +124,28 @@ uv run uipath run --resume
118
124
```
119
125
120
126
-**Entrypoint** is currently unused for Agents, it can be be any string or removed entirely.
127
+
- Files from `.agent-builder/` are automatically copied to the top level if that directory exists
121
128
122
129
**Debug (StudioWeb)**
123
130
124
-
The command used for runs started from Studio Web. It loads the `agent.json` and `bindings.json` from the `.agent-builder` directory and copies them to the root directory and wires-up the debug hooks / channels. Should not be used for local development unless you're working on debug specific features.
131
+
The command used for runs started from Studio Web. Like the `run` command, it automatically prepares files from `.agent-builder/` if that directory exists, then wires-up the debug hooks and communication channels with Studio Web. Should not be used for local development unless you're working on debug specific features.
125
132
126
133
```bash
127
134
# <entrypoint> <args>
128
135
uv run uipath debug agent.json '{}'
129
136
```
130
137
138
+
- Files are loaded from `.agent-builder/` and copied to the top level before execution
139
+
- Establishes bidirectional communication with Studio Web for breakpoints, logs, and state inspection
140
+
131
141
**Dev**
132
142
133
143
Currently work in progress. It's available for standard coded agents but not yet adapted for agents.
134
144
135
145
### Hints
136
146
137
-
- Take a look at the configurations in `./examples`\_
138
-
- You can run any agent from any sub directory of `uipath-agents-python` as long as you have the three required files present.
147
+
- Take a look at the configurations in `./examples`
148
+
- You can run any agent from any sub directory of `uipath-agents-python` as long as you have the three required files present at the top level of that directory.
139
149
- Remember to run `uv run uipath auth (--alpha)` if you get a 401 while executing the agent.
140
150
- You can also download the solution package from Studio Web and get the files from the `.agent-builder` directory or from an already published package.
141
151
- Do not confuse the `uipath debug` command with the `--debug` flag. The former is used for StudioWeb two-way communication for breakpoints, logs and so on and the latter waits for a debugger to be attached to the running process.
0 commit comments