- 1.66.0 (latest)
- 1.65.0
- 1.63.0
- 1.62.0
- 1.60.0
- 1.59.0
- 1.58.0
- 1.57.0
- 1.56.0
- 1.55.0
- 1.54.1
- 1.53.0
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.48.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.39.0
- 1.38.1
- 1.37.0
- 1.36.4
- 1.35.0
- 1.34.0
- 1.33.1
- 1.32.0
- 1.31.1
- 1.30.1
- 1.29.0
- 1.28.1
- 1.27.1
- 1.26.1
- 1.25.0
- 1.24.1
- 1.23.0
- 1.22.1
- 1.21.0
- 1.20.0
- 1.19.1
- 1.18.3
- 1.17.1
- 1.16.1
- 1.15.1
- 1.14.0
- 1.13.1
- 1.12.1
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.1
- 1.7.1
- 1.6.2
- 1.5.0
- 1.4.3
- 1.3.0
- 1.2.0
- 1.1.1
- 1.0.1
- 0.9.0
- 0.8.0
- 0.7.1
- 0.6.0
- 0.5.1
- 0.4.0
- 0.3.1
MatchingEngineIndex(
index_name: str,
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[google.auth.credentials.Credentials] = None,
)
Matching Engine index resource for Vertex AI.
Inheritance
builtins.object > google.cloud.aiplatform.base.VertexAiResourceNoun > builtins.object > google.cloud.aiplatform.base.FutureManager > google.cloud.aiplatform.base.VertexAiResourceNounWithFutureManager > MatchingEngineIndexProperties
create_time
Time this resource was created.
deployed_indexes
Returns a list of deployed index references that originate from this index.
description
Description of the index.
display_name
Display name of this resource.
encryption_spec
Customer-managed encryption key options for this Vertex AI resource.
If this is set, then all resources created by this Vertex AI resource will be encrypted with the provided encryption key.
gca_resource
The underlying resource proto representation.
labels
User-defined labels containing metadata about this resource.
Read more about labels at https://goo.gl/xmQnxf
name
Name of this resource.
resource_name
Full qualified resource name.
update_time
Time this resource was last updated.
Methods
MatchingEngineIndex
MatchingEngineIndex(
index_name: str,
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[google.auth.credentials.Credentials] = None,
)
Retrieves an existing index given an index name or ID.
Example Usage:
my_index = aiplatform.MatchingEngineIndex(
index_name='projects/123/locations/us-central1/indexes/my_index_id'
)
or
my_index = aiplatform.MatchingEngineIndex(
index_name='my_index_id'
)
Name | Description |
index_name |
str
Required. A fully-qualified index resource name or a index ID. Example: "projects/123/locations/us-central1/indexes/my_index_id" or "my_index_id" when project and location are initialized or passed. |
project |
str
Optional. Project to retrieve index from. If not set, project set in aiplatform.init will be used. |
location |
str
Optional. Location to retrieve index from. If not set, location set in aiplatform.init will be used. |
credentials |
auth_credentials.Credentials
Optional. Custom credentials to use to retrieve this Index. Overrides credentials set in aiplatform.init. |
create_brute_force_index
create_brute_force_index(
display_name: str,
contents_delta_uri: str,
dimensions: int,
distance_measure_type: Optional[
google.cloud.aiplatform.matching_engine.matching_engine_index_config.DistanceMeasureType
] = None,
description: Optional[str] = None,
labels: Optional[Dict[str, str]] = None,
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[google.auth.credentials.Credentials] = None,
request_metadata: Optional[Sequence[Tuple[str, str]]] = (),
sync: bool = True,
)
Creates a MatchingEngineIndex resource that uses the brute force algorithm.
Example Usage:
my_index = aiplatform.Index.create_brute_force_index(
display_name="my_display_name",
contents_delta_uri="gs://my_bucket/embeddings",
dimensions=1,
approximate_neighbors_count=150,
distance_measure_type="SQUARED_L2_DISTANCE",
description="my description",
labels={ "label_name": "label_value" },
)
Name | Description |
display_name |
str
Required. The display name of the Index. The name can be up to 128 characters long and can be consist of any UTF-8 characters. |
contents_delta_uri |
str
Required. Allows inserting, updating or deleting the contents of the Matching Engine Index. The string must be a valid Google Cloud Storage directory path. If this field is set when calling IndexService.UpdateIndex, then no other Index field can be also updated as part of the same call. The expected structure and format of the files this URI points to is described at https://docs.google.com/document/d/12DLVB6Nq6rdv8grxfBsPhUA283KWrQ9ZenPBp0zUC30 |
dimensions |
int
Required. The number of dimensions of the input vectors. |
distance_measure_type |
matching_engine_index_config.DistanceMeasureType
Optional. The distance measure used in nearest neighbor search. |
description |
str
Optional. The description of the Index. |
labels |
Dict[str, str]
Optional. The labels with user-defined metadata to organize your Index. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Index(System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable. |
project |
str
Optional. Project to create EntityType in. If not set, project set in aiplatform.init will be used. |
location |
str
Optional. Location to create EntityType in. If not set, location set in aiplatform.init will be used. |
credentials |
auth_credentials.Credentials
Optional. Custom credentials to use to create EntityTypes. Overrides credentials set in aiplatform.init. |
request_metadata |
Sequence[Tuple[str, str]]
Optional. Strings which should be sent along with the request as metadata. |
sync |
bool
Optional. Whether to execute this creation synchronously. If False, this method will be executed in concurrent Future and any downstream object will be immediately returned and synced when the Future has completed. |
encryption_spec |
str
Optional. Customer-managed encryption key spec for data storage. If set, both of the online and offline data storage will be secured by this key. |
create_tree_ah_index
create_tree_ah_index(
display_name: str,
contents_delta_uri: str,
dimensions: int,
approximate_neighbors_count: int,
leaf_node_embedding_count: Optional[int] = None,
leaf_nodes_to_search_percent: Optional[float] = None,
distance_measure_type: Optional[
google.cloud.aiplatform.matching_engine.matching_engine_index_config.DistanceMeasureType
] = None,
description: Optional[str] = None,
labels: Optional[Dict[str, str]] = None,
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[google.auth.credentials.Credentials] = None,
request_metadata: Optional[Sequence[Tuple[str, str]]] = (),
sync: bool = True,
)
Creates a MatchingEngineIndex resource that uses the tree-AH algorithm.
Example Usage:
my_index = aiplatform.Index.create_tree_ah_index(
display_name="my_display_name",
contents_delta_uri="gs://my_bucket/embeddings",
dimensions=1,
approximate_neighbors_count=150,
distance_measure_type="SQUARED_L2_DISTANCE",
leaf_node_embedding_count=100,
leaf_nodes_to_search_percent=50,
description="my description",
labels={ "label_name": "label_value" },
)
Name | Description |
display_name |
str
Required. The display name of the Index. The name can be up to 128 characters long and can be consist of any UTF-8 characters. |
contents_delta_uri |
str
Required. Allows inserting, updating or deleting the contents of the Matching Engine Index. The string must be a valid Google Cloud Storage directory path. If this field is set when calling IndexService.UpdateIndex, then no other Index field can be also updated as part of the same call. The expected structure and format of the files this URI points to is described at https://docs.google.com/document/d/12DLVB6Nq6rdv8grxfBsPhUA283KWrQ9ZenPBp0zUC30 |
dimensions |
int
Required. The number of dimensions of the input vectors. |
approximate_neighbors_count |
int
Required. The default number of neighbors to find via approximate search before exact reordering is performed. Exact reordering is a procedure where results returned by an approximate search algorithm are reordered via a more expensive distance computation. |
leaf_node_embedding_count |
int
Optional. Number of embeddings on each leaf node. The default value is 1000 if not set. |
leaf_nodes_to_search_percent |
float
Optional. The default percentage of leaf nodes that any query may be searched. Must be in range 1-100, inclusive. The default value is 10 (means 10%) if not set. |
distance_measure_type |
matching_engine_index_config.DistanceMeasureType
Optional. The distance measure used in nearest neighbor search. |
description |
str
Optional. The description of the Index. |
labels |
Dict[str, str]
Optional. The labels with user-defined metadata to organize your Index. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Index(System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable. |
project |
str
Optional. Project to create EntityType in. If not set, project set in aiplatform.init will be used. |
location |
str
Optional. Location to create EntityType in. If not set, location set in aiplatform.init will be used. |
credentials |
auth_credentials.Credentials
Optional. Custom credentials to use to create EntityTypes. Overrides credentials set in aiplatform.init. |
request_metadata |
Sequence[Tuple[str, str]]
Optional. Strings which should be sent along with the request as metadata. |
sync |
bool
Optional. Whether to execute this creation synchronously. If False, this method will be executed in concurrent Future and any downstream object will be immediately returned and synced when the Future has completed. |
encryption_spec |
str
Optional. Customer-managed encryption key spec for data storage. If set, both of the online and offline data storage will be secured by this key. |
delete
delete(sync: bool = True)
Deletes this Vertex AI resource. WARNING: This deletion is permanent.
Name | Description |
sync |
bool
Whether to execute this deletion synchronously. If False, this method will be executed in concurrent Future and any downstream object will be immediately returned and synced when the Future has completed. |
list
list(
filter: Optional[str] = None,
order_by: Optional[str] = None,
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[google.auth.credentials.Credentials] = None,
parent: Optional[str] = None,
)
List all instances of this Vertex AI Resource.
Example Usage:
aiplatform.BatchPredictionJobs.list( filter='state="JOB_STATE_SUCCEEDED" AND display_name="my_job"', )
aiplatform.Model.list(order_by="create_time desc, display_name")
Name | Description |
filter |
str
Optional. An expression for filtering the results of the request. For field names both snake_case and camelCase are supported. |
order_by |
str
Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields: |
project |
str
Optional. Project to retrieve list from. If not set, project set in aiplatform.init will be used. |
location |
str
Optional. Location to retrieve list from. If not set, location set in aiplatform.init will be used. |
credentials |
auth_credentials.Credentials
Optional. Custom credentials to use to retrieve list. Overrides credentials set in aiplatform.init. |
parent |
str
Optional. The parent resource name if any to retrieve list from. |
to_dict
to_dict()
Returns the resource proto as a dictionary.
update_embeddings
update_embeddings(
contents_delta_uri: str,
is_complete_overwrite: Optional[bool] = None,
request_metadata: Optional[Sequence[Tuple[str, str]]] = (),
)
Updates the embeddings for this index.
Name | Description |
contents_delta_uri |
str
Required. Allows inserting, updating or deleting the contents of the Matching Engine Index. The string must be a valid Google Cloud Storage directory path. If this field is set when calling IndexService.UpdateIndex, then no other Index field can be also updated as part of the same call. The expected structure and format of the files this URI points to is described at https://docs.google.com/document/d/12DLVB6Nq6rdv8grxfBsPhUA283KWrQ9ZenPBp0zUC30 |
is_complete_overwrite |
bool
Optional. If this field is set together with contentsDeltaUri when calling IndexService.UpdateIndex, then existing content of the Index will be replaced by the data from the contentsDeltaUri. |
request_metadata |
Sequence[Tuple[str, str]]
Optional. Strings which should be sent along with the request as metadata. |
update_metadata
update_metadata(
display_name: Optional[str] = None,
description: Optional[str] = None,
labels: Optional[Dict[str, str]] = None,
request_metadata: Optional[Sequence[Tuple[str, str]]] = (),
)
Updates the metadata for this index.
Name | Description |
display_name |
str
Optional. The display name of the Index. The name can be up to 128 characters long and can be consist of any UTF-8 characters. |
description |
str
Optional. The description of the Index. |
labels |
Dict[str, str]
Optional. The labels with user-defined metadata to organize your Indexs. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Index (System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable. |
request_metadata |
Sequence[Tuple[str, str]]
Optional. Strings which should be sent along with the request as metadata. |
wait
wait()
Helper method that blocks until all futures are complete.