iat_pb2_grpc.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
  2. """Client and server classes corresponding to protobuf-defined services."""
  3. import grpc
  4. import iat_pb2 as iat__pb2
  5. class IatStub(object):
  6. """Missing associated documentation comment in .proto file."""
  7. def __init__(self, channel):
  8. """Constructor.
  9. Args:
  10. channel: A grpc.Channel.
  11. """
  12. self.createRec = channel.stream_stream(
  13. '/iat.Iat/createRec',
  14. request_serializer=iat__pb2.IatRequest.SerializeToString,
  15. response_deserializer=iat__pb2.IatResult.FromString,
  16. )
  17. class IatServicer(object):
  18. """Missing associated documentation comment in .proto file."""
  19. def createRec(self, request_iterator, context):
  20. """采用流的方式持续向服务端写音频数据,及持续从服务端获得结果
  21. 音频请求流,IatRequest.endFlag为true时代表写音频结束
  22. 结果返回流,IatResult.endFlang为true时代表会话识别结束
  23. """
  24. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  25. context.set_details('Method not implemented!')
  26. raise NotImplementedError('Method not implemented!')
  27. def add_IatServicer_to_server(servicer, server):
  28. rpc_method_handlers = {
  29. 'createRec': grpc.stream_stream_rpc_method_handler(
  30. servicer.createRec,
  31. request_deserializer=iat__pb2.IatRequest.FromString,
  32. response_serializer=iat__pb2.IatResult.SerializeToString,
  33. ),
  34. }
  35. generic_handler = grpc.method_handlers_generic_handler(
  36. 'iat.Iat', rpc_method_handlers)
  37. server.add_generic_rpc_handlers((generic_handler,))
  38. # This class is part of an EXPERIMENTAL API.
  39. class Iat(object):
  40. """Missing associated documentation comment in .proto file."""
  41. @staticmethod
  42. def createRec(request_iterator,
  43. target,
  44. options=(),
  45. channel_credentials=None,
  46. call_credentials=None,
  47. insecure=False,
  48. compression=None,
  49. wait_for_ready=None,
  50. timeout=None,
  51. metadata=None):
  52. return grpc.experimental.stream_stream(request_iterator, target, '/iat.Iat/createRec',
  53. iat__pb2.IatRequest.SerializeToString,
  54. iat__pb2.IatResult.FromString,
  55. options, channel_credentials,
  56. insecure, call_credentials, compression, wait_for_ready, timeout, metadata)