),
                messages=[Message(**message) for message in message_history],
            )
            stub = TextGenerationAsyncServiceStub(channel)
            operation = await stub.Completion(request, metadata=self._grpc_metadata)
            async with grpc.aio.secure_channel(
                operation_api_url, channel_credentials
            ) as operation_channel:
                operation_stub = OperationServiceStub(operation_channel)
                while not operation.done:
                    await asyncio.sleep(1)
                    operation_request = GetOperationRequest(operation_id=operation.id)
                    operation = await operation_stub.Get(
                        operation_request, metadata=self._grpc_metadata
                    )
            completion_response = CompletionResponse()
            operation.response.Unpack(completion_response)
            text = completion_response.alternatives[0].message.text
            text = text if stop is None else enforce_stop_tokens(text, stop)
            message = AIMessage(content=text)
            return ChatResult(generations=[ChatGeneration(message=message)])