从 Google Function 内部运行 DocumentAI ocr 作业

问题描述 投票:0回答:1

我尝试使用云功能(类型2)内的文档人工智能处理器对pdf文档进行批处理以获取ocr。我收到以下错误:

raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.PermissionDenied: 403 Your application is authenticating by using local Application Default Credentials. The documentai.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds . [reason: "SERVICE_DISABLED"
domain: "googleapis.com"
metadata {
  key: "service"
  value: "documentai.googleapis.com"
}
metadata {
  key: "consumer"

我的配额项目已设置,我可以从 Vertex Ai 内的 jupyter 笔记本很好地处理 ocr。

可能是什么情况以及可以做什么?谢谢!

我尝试过设置配额项目,并且已设置。问题仅出现在 Cloud Function(第二代)内部

function cloud ocr batch-processing cloud-document-ai
1个回答
0
投票

我已检查与此问题相关的事件,但没有任何报告与您提出此问题的时间和日期一致。

请花时间查看gcloud auth application-default set-quota-project,因为它可以帮助您更好地了解与收到的错误消息相关的要求。

配额项目是一个将用于计费和配额限制的 Google Cloud 项目。在运行此命令之前,必须已使用 $ gcloud auth application-default login 生成 ADC。 ADC 中定义的配额项目将由 Google 客户端库使用。现有应用程序默认凭据必须具有给定项目的 serviceusage.services.use 权限。

您可能需要检查您所需功能的访问权限。以下是其他一些相关文件:

希望这有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.