retail/recommendation-system/bqml-scann/ann_grpc/match_pb2_grpc.py (72 lines of code) (raw):
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import match_pb2 as match__pb2
class MatchServiceStub(object):
"""MatchService is a Google managed service for efficient vector similarity
search at scale.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Match = channel.unary_unary(
'/google.cloud.aiplatform.container.v1alpha1.MatchService/Match',
request_serializer=match__pb2.MatchRequest.SerializeToString,
response_deserializer=match__pb2.MatchResponse.FromString,
)
self.BatchMatch = channel.unary_unary(
'/google.cloud.aiplatform.container.v1alpha1.MatchService/BatchMatch',
request_serializer=match__pb2.BatchMatchRequest.SerializeToString,
response_deserializer=match__pb2.BatchMatchResponse.FromString,
)
class MatchServiceServicer(object):
"""MatchService is a Google managed service for efficient vector similarity
search at scale.
"""
def Match(self, request, context):
"""Returns the nearest neighbors for the query. If it is a sharded
deployment, calls the other shards and aggregates the responses.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def BatchMatch(self, request, context):
"""Returns the nearest neighbors for batch queries. If it is a sharded
deployment, calls the other shards and aggregates the responses.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_MatchServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'Match': grpc.unary_unary_rpc_method_handler(
servicer.Match,
request_deserializer=match__pb2.MatchRequest.FromString,
response_serializer=match__pb2.MatchResponse.SerializeToString,
),
'BatchMatch': grpc.unary_unary_rpc_method_handler(
servicer.BatchMatch,
request_deserializer=match__pb2.BatchMatchRequest.FromString,
response_serializer=match__pb2.BatchMatchResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'google.cloud.aiplatform.container.v1alpha1.MatchService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class MatchService(object):
"""MatchService is a Google managed service for efficient vector similarity
search at scale.
"""
@staticmethod
def Match(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.cloud.aiplatform.container.v1alpha1.MatchService/Match',
match__pb2.MatchRequest.SerializeToString,
match__pb2.MatchResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def BatchMatch(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.cloud.aiplatform.container.v1alpha1.MatchService/BatchMatch',
match__pb2.BatchMatchRequest.SerializeToString,
match__pb2.BatchMatchResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)