Skip to content

Commit 59b4356

Browse files
authored
Merge pull request #409 from UiPath/chore/optional-ingestion
chore: context grounding, optional index ingestion
2 parents 85d65b1 + 928aabb commit 59b4356

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.0.68"
3+
version = "2.0.69"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath/_services/context_grounding_service.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def add_to_index(
5656
source_path: Optional[str] = None,
5757
folder_key: Optional[str] = None,
5858
folder_path: Optional[str] = None,
59+
ingest_data: bool = True,
5960
) -> None:
6061
"""Add content to the index.
6162
@@ -67,6 +68,7 @@ def add_to_index(
6768
source_path (Optional[str]): The source path of the content if it is being uploaded from a file.
6869
folder_key (Optional[str]): The key of the folder where the index resides.
6970
folder_path (Optional[str]): The path of the folder where the index resides.
71+
ingest_data (bool): Whether to ingest data in the index after content is uploaded. Defaults to True.
7072
7173
Raises:
7274
ValueError: If neither content nor source_path is provided, or if both are provided.
@@ -94,7 +96,9 @@ def add_to_index(
9496
folder_path=bucket_folder_path,
9597
content_type=content_type,
9698
)
97-
self.ingest_data(index, folder_key=folder_key, folder_path=folder_path)
99+
100+
if ingest_data:
101+
self.ingest_data(index, folder_key=folder_key, folder_path=folder_path)
98102

99103
@traced(name="add_to_index", run_type="uipath")
100104
@infer_bindings(resource_type="index")
@@ -107,6 +111,7 @@ async def add_to_index_async(
107111
source_path: Optional[str] = None,
108112
folder_key: Optional[str] = None,
109113
folder_path: Optional[str] = None,
114+
ingest_data: bool = True,
110115
) -> None:
111116
"""Asynchronously add content to the index.
112117
@@ -118,6 +123,7 @@ async def add_to_index_async(
118123
source_path (Optional[str]): The source path of the content if it is being uploaded from a file.
119124
folder_key (Optional[str]): The key of the folder where the index resides.
120125
folder_path (Optional[str]): The path of the folder where the index resides.
126+
ingest_data (bool): Whether to ingest data in the index after content is uploaded. Defaults to True.
121127
122128
Raises:
123129
ValueError: If neither content nor source_path is provided, or if both are provided.
@@ -148,9 +154,10 @@ async def add_to_index_async(
148154
content_type=content_type,
149155
)
150156

151-
await self.ingest_data_async(
152-
index, folder_key=folder_key, folder_path=folder_path
153-
)
157+
if ingest_data:
158+
await self.ingest_data_async(
159+
index, folder_key=folder_key, folder_path=folder_path
160+
)
154161

155162
@traced(name="contextgrounding_retrieve", run_type="uipath")
156163
@infer_bindings(resource_type="index")

0 commit comments

Comments
 (0)