1616#
1717
1818from dataclasses import dataclass , field
19- from typing import Dict , List , Optional , Sequence , Tuple , Union
19+ from typing import Dict , List , Optional , Sequence , Tuple , Union , Any
2020
2121from google .auth import credentials as auth_credentials
2222from google .cloud .aiplatform import base
@@ -208,7 +208,8 @@ class MatchNeighbor:
208208 For example, values [1,2,3] with dimensions [4,5,6] means value 1 is
209209 of the 4th dimension, value 2 is of the 4th dimension, and value 3 is
210210 of the 6th dimension.
211-
211+ embedding_metadata (Dict[str,Any]):
212+ Optional. The embedding metadata of the matching datapoint.
212213 """
213214
214215 id : str
@@ -220,6 +221,7 @@ class MatchNeighbor:
220221 numeric_restricts : Optional [List [NumericNamespace ]] = None
221222 sparse_embedding_values : Optional [List [float ]] = None
222223 sparse_embedding_dimensions : Optional [List [int ]] = None
224+ embedding_metadata : Optional [Dict [str ,Any ]] = None
223225
224226 def from_index_datapoint (
225227 self , index_datapoint : gca_index_v1beta1 .IndexDatapoint
@@ -276,6 +278,8 @@ def from_index_datapoint(
276278 self .sparse_embedding_dimensions = (
277279 index_datapoint .sparse_embedding .dimensions
278280 )
281+ if index_datapoint .embedding_metadata is not None :
282+ self .embedding_metadata = dict (index_datapoint .embedding_metadata )
279283 return self
280284
281285 def from_embedding (self , embedding : match_service_pb2 .Embedding ) -> "MatchNeighbor" :
0 commit comments