googleapis / googleapis/python-aiplatform

Missing embedding_metadata in response - matching engine - Vector Store

Aperta
#6,145 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
api: vertex-ai
Lingua principale
Python
Stelle
905
Fork
465
Merge medio
1g 13h
PR unite (30g)
44

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.