Skip to content

Commit 78a3905

Browse files
committed
docs: add reinvoke warning and update docs
1 parent 255be9f commit 78a3905

2 files changed

Lines changed: 73 additions & 6 deletions

File tree

docs/human_in_the_loop.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ For more information on UiPath apps, refer to the [UiPath Apps User Guide](https
1313

1414
#### Attributes:
1515

16-
- **name** (Optional[str]): The name of the app.
17-
- **key** (Optional[str]): The key of the app.
16+
- **app_name** (Optional[str]): The name of the app.
17+
- **app_folder_path** (Optional[str]): The folder path of the app.
18+
- **app_key** (Optional[str]): The key of the app.
1819
- **title** (str): The title of the action to create.
1920
- **data** (Optional[Dict[str, Any]]): Values that the action will be populated with.
2021
- **app_version** (Optional[int]): The version of the app (defaults to 1).
@@ -24,7 +25,7 @@ For more information on UiPath apps, refer to the [UiPath Apps User Guide](https
2425

2526
```python
2627
from uipath_llamaindex.models import CreateActionEvent
27-
action_output = ctx.write_event_to_stream(CreateActionEvent(name="AppName", title="Escalate Issue", data={"key": "value"}, app_version=1, assignee="user@example.com"))
28+
action_output = ctx.write_event_to_stream(CreateActionEvent(app_name="AppName", app_folder_path="MyFolderPath", title="Escalate Issue", data={"key": "value"}, app_version=1, assignee="user@example.com"))
2829
```
2930

3031
For a practical implementation of the `CreateAction` model, refer to the [action-center-hitl-agent](https://github.com/UiPath/uipath-llamaindex-python/tree/main/samples/action-center-hitl-agent). This sample demonstrates how to create an action with dynamic input.
@@ -39,12 +40,13 @@ The `WaitAction` model is used to wait for an action to be handled. This model i
3940
#### Attributes:
4041

4142
- **action** (Action): The instance of the action to wait for.
43+
- **app_folder_path** (Optional[str]): The folder path of the app.
4244

4345
#### Example:
4446

4547
```python
4648
from uipath_llamaindex.models import WaitActionEvent
47-
action_output = ctx.write_event_to_stream(WaitActionEvent(action=my_action_instance))
49+
action_output = ctx.write_event_to_stream(WaitActionEvent(action=my_action_instance, app_folder_path="MyFolderPath"))
4850
```
4951

5052
---
@@ -61,15 +63,20 @@ Upon completion of the invoked process, the current agent will automatically res
6163
#### Attributes:
6264

6365
- **name** (str): The name of the process to invoke.
66+
- **process_folder_path** (Optional[str]): The folder path of the process.
6467
- **input_arguments** (Optional[Dict[str, Any]]): A dictionary containing the input arguments required for the invoked process.
6568

6669
#### Example:
6770

6871
```python
6972
from uipath_llamaindex.models import InvokeProcessEvent
70-
process_output = ctx.write_event_to_stream(InvokeProcessEvent(name="MyProcess", input_arguments={"arg1": "value1"}))
73+
process_output = ctx.write_event_to_stream(InvokeProcessEvent(name="MyProcess", process_folder_path="MyFolderPath", input_arguments={"arg1": "value1"}))
7174
```
7275

76+
/// warning
77+
An agent can invoke itself if needed, but this must be done with caution. Be mindful that using the same name for invocation may lead to unintentional loops. To prevent recursion issues, implement safeguards like exit conditions.
78+
///
79+
7380
For a practical implementation of the `InvokeProcess` model, refer to the [multi-agent sample](https://github.com/UiPath/uipath-llamaindex-python/tree/main/samples/multi-agent). This sample demonstrates how to invoke a process with dynamic input arguments, showcasing the integration of the interrupt functionality within a multi-agent system or a system where an agent integrates with RPA processes and API workflows.
7481

7582
---
@@ -82,10 +89,11 @@ the job has already been created.
8289
#### Attributes:
8390

8491
- **job** (Job): The instance of the job that the agent will wait for. This should be a valid job object that has been previously created.
92+
- **process_folder_path** (Optional[str]): The folder path of the process.
8593

8694
#### Example:
8795

8896
```python
8997
from uipath_llamaindex.models import WaitJobEvent
90-
job_output = ctx.write_event_to_stream(WaitJobEvent(job=my_job_instance))
98+
job_output = ctx.write_event_to_stream(WaitJobEvent(job=my_job_instance, process_folder_path="MyFolderPath"))
9199
```

samples/multi-agent/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Company Research Agent
2+
3+
This UiPath LlamaIndex agent assists in researching companies using AI and human-in-the-loop (HITL) collaboration. It triggers external processes, waits for human input, and generates validated reports.
4+
5+
## Features
6+
* Triggers a UiPath workflow to research and analyze the given company name
7+
* Incorporates human feedback to validate the analysis
8+
* Produces the final, validated company report
9+
10+
## Getting Started
11+
12+
### 1. Clone the Repository
13+
14+
```sh
15+
git clone https://github.com/your-org/uipath-llamaindex-python.git
16+
cd uipath-llamaindex-python/samples/multi-agent
17+
```
18+
19+
### 2. Set Up Python Environment
20+
21+
```sh
22+
python -m venv .venv
23+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
24+
pip install -r requirements.txt
25+
```
26+
27+
Or use `pyproject.toml` with pip:
28+
```sh
29+
pip install .
30+
```
31+
32+
### 3. Configure Environment
33+
34+
Copy `.env.template` to `.env` and fill in your secrets (API keys, tokens, etc.)
35+
36+
### 4. Run the Agent
37+
38+
```sh
39+
uipath run agent --file ./input.json
40+
```
41+
42+
> **Warning:** An agent can invoke itself if needed, but this must be done with caution. Be mindful that using the same name for invocation may lead to unintentional loops. To prevent recursion issues, implement safeguards like exit conditions.
43+
44+
### 5. Resume
45+
46+
To approve the rules and commit them use:
47+
```sh
48+
uipath run agent true --resume
49+
```
50+
51+
Example:
52+
```sh
53+
uipath run agent --file ./input.json
54+
```
55+
56+
### Deployment Guide
57+
58+
To run the company-researcher-agent on the UiPath Cloud Platform, follow this guide:
59+
[Ticket Classification Sample Deployment](https://github.com/UiPath/uipath-langchain-python/tree/main/samples/ticket-classification)

0 commit comments

Comments
 (0)