IndexOperations Class
Represents a client for performing operations on index assets.
You should not instantiate this class directly. Instead, you should create MLClient and use this client via the property MLClient.index
- Inheritance
-
azure.ai.ml._scope_dependent_operations._ScopeDependentOperationsIndexOperations
Constructor
IndexOperations(*, operation_scope: OperationScope, operation_config: OperationConfig, credential: TokenCredential, datastore_operations: DatastoreOperations, all_operations: OperationsContainer, **kwargs: Any)
Keyword-Only Parameters
Name | Description |
---|---|
operation_scope
Required
|
|
operation_config
Required
|
|
credential
Required
|
|
datastore_operations
Required
|
|
all_operations
Required
|
|
Methods
build_index |
Builds an index on the cloud using the Azure AI Resources service. |
create_or_update |
Returns created or updated index asset. If not already in storage, asset will be uploaded to the workspace's default datastore. |
get |
Returns information about the specified index asset. |
list |
List all Index assets in workspace. If an Index is specified by name, list all version of that Index. |
build_index
Builds an index on the cloud using the Azure AI Resources service.
build_index(*, name: str, embeddings_model_config: ModelConfiguration, data_source_citation_url: str | None = None, tokens_per_chunk: int | None = None, token_overlap_across_chunks: int | None = None, input_glob: str | None = None, document_path_replacement_regex: str | None = None, index_config: AzureAISearchConfig | None = None, input_source: IndexDataSource | str, input_source_credential: ManagedIdentityConfiguration | UserIdentityConfiguration | None = None) -> Index | Job
Keyword-Only Parameters
Name | Description |
---|---|
name
|
The name of the index to be created. |
embeddings_model_config
|
<xref:azure.ai.ml.entities._indexes.ModelConfiguration>
Model config for the embedding model. |
data_source_citation_url
|
The URL of the data source. |
tokens_per_chunk
|
The size of chunks to be used for indexing. |
token_overlap_across_chunks
|
The amount of overlap between chunks. |
input_glob
|
The glob pattern to be used for indexing. |
document_path_replacement_regex
|
The regex pattern for replacing document paths. |
index_config
|
Optional[<xref:azure.ai.ml.entities._indexes.AzureAISearchConfig>]
The configuration for the ACS output. |
input_source
|
The input source for the index. |
input_source_credential
|
The identity to be used for the index. |
Returns
Type | Description |
---|---|
If the source_input is a GitSource, returns a created DataIndex Job object. |
Exceptions
Type | Description |
---|---|
If the source_input is not type ~typing.Str or ~azure.ai.ml.entities._indexes.LocalSource. |
create_or_update
Returns created or updated index asset.
If not already in storage, asset will be uploaded to the workspace's default datastore.
create_or_update(index: Index, **kwargs) -> Index
Parameters
Name | Description |
---|---|
index
Required
|
Index asset object. |
Keyword-Only Parameters
Name | Description |
---|---|
name
|
The name of the index to be created. |
embeddings_model_config
|
<xref:azure.ai.ml.entities._indexes.ModelConfiguration>
Model config for the embedding model. |
data_source_citation_url
|
The URL of the data source. |
tokens_per_chunk
|
The size of chunks to be used for indexing. |
token_overlap_across_chunks
|
The amount of overlap between chunks. |
input_glob
|
The glob pattern to be used for indexing. |
document_path_replacement_regex
|
The regex pattern for replacing document paths. |
index_config
|
Optional[<xref:azure.ai.ml.entities._indexes.AzureAISearchConfig>]
The configuration for the ACS output. |
input_source
|
The input source for the index. |
input_source_credential
|
The identity to be used for the index. |
Returns
Type | Description |
---|---|
Index asset object. |
Exceptions
Type | Description |
---|---|
If the source_input is not type ~typing.Str or ~azure.ai.ml.entities._indexes.LocalSource. |
get
Returns information about the specified index asset.
get(name: str, *, version: str | None = None, label: str | None = None, **kwargs) -> Index
Parameters
Name | Description |
---|---|
name
Required
|
Name of the index asset. |
Keyword-Only Parameters
Name | Description |
---|---|
version
|
Version of the index asset. Mutually exclusive with label. |
label
|
The label of the index asset. Mutually exclusive with version. |
Returns
Type | Description |
---|---|
Index asset object. |
Exceptions
Type | Description |
---|---|
Raised if Index cannot be successfully validated. Details will be provided in the error message. |
list
List all Index assets in workspace.
If an Index is specified by name, list all version of that Index.
list(name: str | None = None, *, list_view_type: ListViewType = ListViewType.ACTIVE_ONLY, **kwargs) -> Iterable[Index]
Parameters
Name | Description |
---|---|
name
Required
|
Name of the model. |
Keyword-Only Parameters
Name | Description |
---|---|
list_view_type
|
View type for including/excluding (for example) archived models. Defaults to <xref:ListViewType.ACTIVE_ONLY>. |
Returns
Type | Description |
---|---|
An iterator like instance of Index objects |
Exceptions
Type | Description |
---|---|
If the source_input is not type ~typing.Str or ~azure.ai.ml.entities._indexes.LocalSource. |
Azure SDK for Python