def async_recognize(self, config, audio): from google.longrunning.operations_pb2 import Operation self.config = config self.audio = audio operation = Operation() return operation
def long_running_recognize(self, config, audio): from google.gapic.longrunning.operations_client import OperationsClient from google.gax import _OperationFuture from google.longrunning.operations_pb2 import Operation from google.cloud.proto.speech.v1.cloud_speech_pb2 import ( LongRunningRecognizeResponse) self.config = config self.audio = audio operations_client = mock.Mock(spec=OperationsClient) operation_future = _OperationFuture(Operation(), operations_client, LongRunningRecognizeResponse, {}) return operation_future