Skip to content

Commit ecb6ce4

Browse files
authored
Merge pull request #86 from UiPath/fix/update_new_contracts
fix: update samples and docs
2 parents e3c0ca3 + 50858a1 commit ecb6ce4

115 files changed

Lines changed: 16343 additions & 8143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The SDK provides a command-line interface for creating, packaging, and deploying
4747
uipath init
4848
```
4949

50-
Running `uipath init` will process the graph definitions in the `llama_index.json` file and create the corresponding `entry-points.json` file needed for deployment.
50+
Running `uipath init` will process the workflow definitions in the `llama_index.json` file and create the corresponding `entry-points.json` file needed for deployment.
5151

5252
For more details on the configuration format, see the [UiPath configuration specifications](https://github.com/UiPath/uipath-python/blob/main/specs/README.md).
5353

docs/human_in_the_loop.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,59 @@ It focuses on the **ctx.write_event_to_stream** LlamaIndex functionality.
55

66
## Models Overview
77

8-
### 1. CreateAction
8+
### 1. CreateTaskEvent
99

10-
The `CreateAction` model is utilized to create an escalation action within the UiPath Action Center as part of an interrupt context. The action will rely on a previously created UiPath app.
10+
The `CreateTaskEvent` model is utilized to create an escalation task within the UiPath Action Center as part of an interrupt context. The task will rely on a previously created UiPath app.
1111
After addressing the escalation, the current agent will resume execution.
12-
For more information on UiPath apps, refer to the [UiPath Apps User Guide](https://docs.uipath.com/apps/automation-cloud/latest/user-guide/introduction).
12+
For more information on UiPath Apps, refer to the [UiPath Apps User Guide](https://docs.uipath.com/apps/automation-cloud/latest/user-guide/introduction).
1313

1414
#### Attributes:
1515

1616
- **app_name** (Optional[str]): The name of the app.
1717
- **app_folder_path** (Optional[str]): The folder path of the app.
1818
- **app_key** (Optional[str]): The key of the app.
19-
- **title** (str): The title of the action to create.
20-
- **data** (Optional[Dict[str, Any]]): Values that the action will be populated with.
21-
- **app_version** (Optional[int]): The version of the app (defaults to 1).
19+
- **title** (str): The title of the task to create.
20+
- **data** (Optional[Dict[str, Any]]): Values that the task will be populated with.
2221
- **assignee** (Optional[str]): The username or email of the person assigned to handle the escalation.
2322

2423
#### Example:
2524

2625
```python
27-
from uipath_llamaindex.models import CreateActionEvent
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"))
26+
from uipath_llamaindex.models import CreateTaskEvent
27+
ctx.write_event_to_stream(CreateTaskEvent(app_name="AppName", app_folder_path="MyFolderPath", title="Escalate Issue", data={"key": "value"}, assignee="user@example.com"))
28+
task_data = await ctx.wait_for_event(HumanResponseEvent)
2929
```
3030

31-
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.
31+
For a practical implementation of the `CreateTaskEvent` 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 a task with dynamic input.
3232

3333

3434
---
3535

36-
### 2. WaitAction
36+
### 2. WaitTaskEvent
3737

38-
The `WaitAction` model is used to wait for an action to be handled. This model is intended for scenarios where the action has already been created.
38+
The `WaitTaskEvent` model is used to wait for a task to be approved. This model is intended for scenarios where the task has already been created.
3939

4040
#### Attributes:
4141

42-
- **action** (Action): The instance of the action to wait for.
42+
- **action** (Task): The instance of the task to wait for.
4343
- **app_folder_path** (Optional[str]): The folder path of the app.
4444

4545
#### Example:
4646

4747
```python
48-
from uipath_llamaindex.models import WaitActionEvent
49-
action_output = ctx.write_event_to_stream(WaitActionEvent(action=my_action_instance, app_folder_path="MyFolderPath"))
48+
from uipath_llamaindex.models import WaitTaskEvent
49+
ctx.write_event_to_stream(WaitTaskEvent(action=my_task_instance, app_folder_path="MyFolderPath"))
50+
task_data = await ctx.wait_for_event(HumanResponseEvent)
5051
```
5152

5253
---
5354

5455
> 💡 UiPath LlamaIndex sdk also supports **Robot/Agent-in-the-loop** scenarios. In this context, the execution of one agent
5556
> can be suspended until another robot or agent finishes its execution.
5657
57-
### 3. InvokeProcess
58+
### 3. InvokeProcessEvent
5859

59-
The `InvokeProcess` model is utilized to invoke a process within the UiPath cloud platform.
60+
The `InvokeProcessEvent` model is utilized to invoke a process within the UiPath cloud platform.
6061
This process can be of various types, including API workflows, Agents or RPA automation.
6162
Upon completion of the invoked process, the current agent will automatically resume execution.
6263

@@ -70,20 +71,21 @@ Upon completion of the invoked process, the current agent will automatically res
7071

7172
```python
7273
from uipath_llamaindex.models import InvokeProcessEvent
73-
process_output = ctx.write_event_to_stream(InvokeProcessEvent(name="MyProcess", process_folder_path="MyFolderPath", input_arguments={"arg1": "value1"}))
74+
ctx.write_event_to_stream(InvokeProcessEvent(name="MyProcess", process_folder_path="MyFolderPath", input_arguments={"arg1": "value1"}))
75+
job_data = await ctx.wait_for_event(HumanResponseEvent)
7476
```
7577

7678
/// warning
7779
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.
7880
///
7981

80-
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.
82+
For a practical implementation of the `InvokeProcessEvent` 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.
8183

8284
---
8385

8486
### 4. WaitJob
8587

86-
The `WaitJob` model is used to wait for a job completion. Unlike `InvokeProcess`, which automatically creates a job, this model is intended for scenarios where
88+
The `WaitJobEvent` model is used to wait for a job completion. Unlike `InvokeProcessEvent`, which automatically creates a job, this model is intended for scenarios where
8789
the job has already been created.
8890

8991
#### Attributes:
@@ -95,5 +97,6 @@ the job has already been created.
9597

9698
```python
9799
from uipath_llamaindex.models import WaitJobEvent
98-
job_output = ctx.write_event_to_stream(WaitJobEvent(job=my_job_instance, process_folder_path="MyFolderPath"))
100+
ctx.write_event_to_stream(WaitJobEvent(job=my_job_instance, process_folder_path="MyFolderPath"))
101+
job_data = await ctx.wait_for_event(HumanResponseEvent)
99102
```

0 commit comments

Comments
 (0)