googleapis / googleapis/python-aiplatform

Missing embedding_metadata in response - matching engine - Vector Store

Open
#6,145 1 comment 0 reactions 0 assignees View on GitHub
api: vertex-ai
Dominant language
Python
Stars
905
Forks
465
Avg merge
1d 13h
Merged PRs (30d)
44

Description

I am using the preview feature of vertexai vector store that support `embedding_metadata`.
When using the curl command I can retrieve the metadata associated with a datapoint.

However, this doesn't work with the python SDK.

The `find_neighbors` method of `MatchingEngineIndexEndpoint` accepts the parameter `return_full_datapoint` which then correctly adds the param to the api endpoint.
The issue is that when the response is cast into the class `MatchNeighbor`, which does not contain a field for `embedding_metadata`, this information is lost even though it was retrieved.

Solution is to correctly cast it and/or update the definition of `MatchNeighbor`.

The solution I'm currently using in my own fork is to add

```python
if (index_datapoint.embedding_metadata is not None):
self.embedding_metadata = index_datapoint.embedding_metadata
```

in line 280 of matching_engine.matching_engine_index_endpoint.py

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.