# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from cogneed_protos.public.audio import audio_api_pb2 as cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2


class StreamAudioServiceStub(object):
  """*
  Main service used in the real-time detection of keywords.
  The stream_audio method should be used to initialize the stream and then send audio data.
  The get_keyword_description method should be used the the detections to fetch the description to display.
  """

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.stream_audio = channel.stream_stream(
        '/ai.cogneed.audio.api.StreamAudioService/stream_audio',
        request_serializer=cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2.AudioDetectRequest.SerializeToString,
        response_deserializer=cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2.DetectionResponse.FromString,
        )
    self.get_keyword_description = channel.unary_unary(
        '/ai.cogneed.audio.api.StreamAudioService/get_keyword_description',
        request_serializer=cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2.DescriptionRequest.SerializeToString,
        response_deserializer=cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2.DescriptionResponse.FromString,
        )


class StreamAudioServiceServicer(object):
  """*
  Main service used in the real-time detection of keywords.
  The stream_audio method should be used to initialize the stream and then send audio data.
  The get_keyword_description method should be used the the detections to fetch the description to display.
  """

  def stream_audio(self, request_iterator, context):
    """Method responsible for streaming the detections.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def get_keyword_description(self, request, context):
    """Method responsible for fetching the description to display given a keyword.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_StreamAudioServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'stream_audio': grpc.stream_stream_rpc_method_handler(
          servicer.stream_audio,
          request_deserializer=cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2.AudioDetectRequest.FromString,
          response_serializer=cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2.DetectionResponse.SerializeToString,
      ),
      'get_keyword_description': grpc.unary_unary_rpc_method_handler(
          servicer.get_keyword_description,
          request_deserializer=cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2.DescriptionRequest.FromString,
          response_serializer=cogneed__protos_dot_public_dot_audio_dot_audio__api__pb2.DescriptionResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'ai.cogneed.audio.api.StreamAudioService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
