Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool]¶
Delete by vector ID or other criteria.
Parameters
ids – List of ids to delete.
**kwargs – Other keyword arguments that subclasses might use.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_components(project_id: str, region: str, gcs_bucket_name: str, index_id: str, endpoint_id: str, credentials_path: Optional[str] = None, embedding: Optional[Embeddings] = None) → MatchingEngine[source]¶
Takes the object creation out of the constructor.
Parameters
project_id – The GCP project id.
region – The default location making the API calls. It must have
regional. (the same location as the GCS bucket and must be) – 
gcs_bucket_name – The location where the vectors will be stored in
created. (order for the index to be) – 
index_id – The id of the created index.
endpoint_id – The id of the created endpoint.
credentials_path – (Optional) The path of the Google credentials on
system. (the local file) – 
embedding – The Embeddings that will be used for
texts. (embedding the) – 
Returns
A configured MatchingEngine with the texts added to the index.