Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions docs/human_in_the_loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ For more information on UiPath apps, refer to the [UiPath Apps User Guide](https

#### Attributes:

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

```python
from uipath.models import CreateAction
action_output = interrupt(CreateAction(name="AppName", title="Escalate Issue", data={"key": "value"}, app_version=1, assignee="[email protected]"))
action_output = interrupt(CreateAction(app_name="AppName", app_folder_path="MyFolderPath", title="Escalate Issue", data={"key": "value"}, app_version=1, assignee="[email protected]"))
```

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

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

#### Example:

```python
from uipath.models import WaitAction
action_output = interrupt(WaitAction(action=my_action_instance))
action_output = interrupt(WaitAction(action=my_action_instance, app_folder_path="MyFolderPath"))
```

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

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

#### Example:

```python
from uipath.models import InvokeProcess
process_output = interrupt(InvokeProcess(name="MyProcess", input_arguments={"arg1": "value1"}))
process_output = interrupt(InvokeProcess(name="MyProcess", process_folder_path="MyFolderPath", input_arguments={"arg1": "value1"}))
```

/// 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.
///

For a practical implementation of the `InvokeProcess` model, refer to the [multi-agent-planner-researcher-coder-distributed sample](https://github.com/UiPath/uipath-langchain-python/tree/main/samples/multi-agent-planner-researcher-coder-distributed). 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.

---
Expand All @@ -82,10 +89,11 @@ the job has already been created.
#### Attributes:

- **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.
- **process_folder_path** (Optional[str]): The folder path of the process.

#### Example:

```python
from uipath.models import WaitJob
job_output = interrupt(WaitJob(job=my_job_instance))
job_output = interrupt(WaitJob(job=my_job_instance, process_folder_path="MyFolderPath"))
```
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ Select feed number: 3
> **Note:** Ensure that the display names for the coder and researcher agent processes are *coder-agent* and *researcher-agent*,
and that all 3 agents are placed in the same folder.

> **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.

7. **Run the Planner Agent with Any Input Question**
> **Tip:** For a five-step action plan, consider using the following input:
```
Expand Down
Loading