调用Google gemini api 报错且最终没有解决hhh

错误如下:DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings…
解决方法:点击链接,根据要求安装 gcloud CLI
在这里插入图片描述
运行gcloud auth application-default login
中间报错,”因为在此系统上禁止运行脚本“,使用命令set-ExecutionPolicy RemoteSigned
在这里插入图片描述

在这里插入图片描述
哈哈结果还是报错
继续看文档,使用在这里插入图片描述
gcloud auth application-default login --impersonate-service-account SERVICE_ACCT_EMAIL
在这里插入图片描述
创建json文件
哈哈新错误
Deadline of 60.0s exceeded while calling target function, last exception: 503 failed to connect to all addresses;
解决方法
genai.configure(api_key= f"{GOOGLE_API_KEY}", transport=“rest”)github给出得方法
在这里插入图片描述
??就这样吧


使用魔法后的新错误
(‘Unable to acquire impersonated credentials’, ‘{\n “error”: {\n “code”: 400,\n “message”: “Invalid form of account ID SERVICE_ACCT_EMAIL. Should be [Gaia ID |Email |Unique ID |] of the account”,\n “status”: “INVALID_ARGUMENT”\n }\n}\n’)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值