Context Grounding
ContextGroundingService ¶
Service for managing semantic automation contexts in UiPath.
Context Grounding is a feature that helps in understanding and managing the semantic context in which automation processes operate. It provides capabilities for indexing, retrieving, and searching through contextual information that can be used to enhance AI-enabled automation.
This service requires a valid folder key to be set in the environment, as context grounding operations are always performed within a specific folder context.
add_to_index ¶
add_to_index(
name,
blob_file_path,
content_type=None,
content=None,
source_path=None,
folder_key=None,
folder_path=None,
ingest_data=True,
)
Add content to the index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the index to add content to. |
required |
content_type
|
str | None
|
The MIME type of the file. For file inputs this is computed dynamically. Default is "application/octet-stream". |
None
|
blob_file_path
|
str
|
The path where the blob will be stored in the storage bucket. |
required |
content
|
str | bytes | None
|
The content to be added, either as a string or bytes. |
None
|
source_path
|
str | None
|
The source path of the content if it is being uploaded from a file. |
None
|
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
ingest_data
|
bool
|
Whether to ingest data in the index after content is uploaded. Defaults to True. |
True
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither content nor source_path is provided, or if both are provided. |
add_to_index_async
async
¶
add_to_index_async(
name,
blob_file_path,
content_type=None,
content=None,
source_path=None,
folder_key=None,
folder_path=None,
ingest_data=True,
)
Asynchronously add content to the index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the index to add content to. |
required |
content_type
|
str | None
|
The MIME type of the file. For file inputs this is computed dynamically. Default is "application/octet-stream". |
None
|
blob_file_path
|
str
|
The path where the blob will be stored in the storage bucket. |
required |
content
|
str | bytes | None
|
The content to be added, either as a string or bytes. |
None
|
source_path
|
str | None
|
The source path of the content if it is being uploaded from a file. |
None
|
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
ingest_data
|
bool
|
Whether to ingest data in the index after content is uploaded. Defaults to True. |
True
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither content nor source_path is provided, or if both are provided. |
create_index ¶
create_index(
name,
source,
description=None,
advanced_ingestion=True,
preprocessing_request=LLMV4_REQUEST,
folder_key=None,
folder_path=None,
)
Create a new context grounding index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the index to create. |
required |
source
|
SourceConfig
|
Source configuration using one of: - BucketSourceConfig: For storage buckets - GoogleDriveSourceConfig: For Google Drive - DropboxSourceConfig: For Dropbox - OneDriveSourceConfig: For OneDrive - ConfluenceSourceConfig: For Confluence The source can include an optional indexer field for scheduled indexing: source.indexer = Indexer(cron_expression="0 0 18 ? * 2", time_zone_id="UTC") |
required |
description
|
str | None
|
Description of the index. |
None
|
advanced_ingestion
|
bool | None
|
Enable advanced ingestion with preprocessing. Defaults to True. |
True
|
preprocessing_request
|
str | None
|
The OData type for preprocessing request. Defaults to LLMV4_REQUEST. |
LLMV4_REQUEST
|
folder_key
|
str | None
|
The key of the folder where the index will be created. |
None
|
folder_path
|
str | None
|
The path of the folder where the index will be created. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ContextGroundingIndex |
ContextGroundingIndex
|
The created index information. |
create_index_async
async
¶
create_index_async(
name,
source,
description=None,
advanced_ingestion=True,
preprocessing_request=LLMV4_REQUEST,
folder_key=None,
folder_path=None,
)
Create a new context grounding index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the index to create. |
required |
source
|
SourceConfig
|
Source configuration using one of: - BucketSourceConfig: For storage buckets - GoogleDriveSourceConfig: For Google Drive - DropboxSourceConfig: For Dropbox - OneDriveSourceConfig: For OneDrive - ConfluenceSourceConfig: For Confluence The source can include an optional indexer field for scheduled indexing: source.indexer = Indexer(cron_expression="0 0 18 ? * 2", time_zone_id="UTC") |
required |
description
|
str | None
|
Description of the index. |
None
|
advanced_ingestion
|
bool | None
|
Enable advanced ingestion with preprocessing. Defaults to True. |
True
|
preprocessing_request
|
str | None
|
The OData type for preprocessing request. Defaults to LLMV4_REQUEST. |
LLMV4_REQUEST
|
folder_key
|
str | None
|
The key of the folder where the index will be created. |
None
|
folder_path
|
str | None
|
The path of the folder where the index will be created. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ContextGroundingIndex |
ContextGroundingIndex
|
The created index information. |
delete_index ¶
Delete a context grounding index.
This method removes the specified context grounding index from Orchestrator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
ContextGroundingIndex
|
The context grounding index to delete. |
required |
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
delete_index_async
async
¶
Asynchronously delete a context grounding index.
This method removes the specified context grounding index from Orchestrator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
ContextGroundingIndex
|
The context grounding index to delete. |
required |
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
ingest_data ¶
Ingest data into the context grounding index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
ContextGroundingIndex
|
The context grounding index to perform data ingestion. |
required |
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
ingest_data_async
async
¶
Asynchronously ingest data into the context grounding index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
ContextGroundingIndex
|
The context grounding index to perform data ingestion. |
required |
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
retrieve ¶
Retrieve context grounding index information by its name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the context index to retrieve. |
required |
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ContextGroundingIndex |
ContextGroundingIndex
|
The index information, including its configuration and metadata if found. |
Raises:
| Type | Description |
|---|---|
Exception
|
If no index with the given name is found. |
retrieve_async
async
¶
Asynchronously retrieve context grounding index information by its name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the context index to retrieve. |
required |
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ContextGroundingIndex |
ContextGroundingIndex
|
The index information, including its configuration and metadata if found. |
Raises:
| Type | Description |
|---|---|
Exception
|
If no index with the given name is found. |
retrieve_by_id ¶
Retrieve context grounding index information by its ID.
This method provides direct access to a context index using its unique identifier, which can be more efficient than searching by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the context index. |
required |
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The index information, including its configuration and metadata. |
retrieve_by_id_async
async
¶
Retrieve asynchronously context grounding index information by its ID.
This method provides direct access to a context index using its unique identifier, which can be more efficient than searching by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the context index. |
required |
folder_key
|
str | None
|
The key of the folder where the index resides. |
None
|
folder_path
|
str | None
|
The path of the folder where the index resides. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The index information, including its configuration and metadata. |
search ¶
Search for contextual information within a specific index.
This method performs a semantic search against the specified context index, helping to find relevant information that can be used in automation processes. The search is powered by AI and understands natural language queries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the context index to search in. |
required |
query
|
str
|
The search query in natural language. |
required |
number_of_results
|
int
|
Maximum number of results to return. Defaults to 10. |
10
|
Returns:
| Type | Description |
|---|---|
list[ContextGroundingQueryResponse]
|
List[ContextGroundingQueryResponse]: A list of search results, each containing relevant contextual information and metadata. |
search_async
async
¶
Search asynchronously for contextual information within a specific index.
This method performs a semantic search against the specified context index, helping to find relevant information that can be used in automation processes. The search is powered by AI and understands natural language queries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the context index to search in. |
required |
query
|
str
|
The search query in natural language. |
required |
number_of_results
|
int
|
Maximum number of results to return. Defaults to 10. |
10
|
Returns:
| Type | Description |
|---|---|
list[ContextGroundingQueryResponse]
|
List[ContextGroundingQueryResponse]: A list of search results, each containing relevant contextual information and metadata. |