small fix matching engine AttributeError - object has no attribute (#13763)

This PR is fixing an attributeError: object endpoint has no attribute
"_public_match_client" when using gcp matching engine with private VPC
network.

@baskaryan, @eyurtsev, @hwchase17.

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
Johnny 2023-11-29 11:42:29 +08:00 committed by GitHub
parent 750485eaa8
commit 6463d2d0bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,7 +233,9 @@ class MatchingEngine(VectorStore):
filter = filter or []
# If the endpoint is public we use the find_neighbors function.
if self.endpoint._public_match_client:
if hasattr(self.endpoint, "_public_match_client") and (
self.endpoint._public_match_client
):
response = self.endpoint.find_neighbors(
deployed_index_id=self._get_index_id(),
queries=[embedding],