gpt4 book ai didi

python-3.x - "Quota exceeded for quota group ' ReadGroup ' and limit ' 每个用户每 100 秒服务 google api 的读取请求

转载 作者:行者123 更新时间:2023-12-04 15:36:29 28 4
gpt4 key购买 nike

我尝试计算请求 api 和时间的代码

a =0
count_time = 0
while True:
start = time.time()
if (sheet.cell(22,9).value) == "#N/A":
a = a+1
print("google read request: ",a)
time.sleep(1)


if (sheet.cell(22,9).value) == "#N/A":
a = a+1
print("google read request: ",a)
time.sleep(1)

if (sheet.cell(22,9).value) == "#N/A":
a = a+1
print("google read request: ",a)
time.sleep(1)


success_loop_time = time.time()-start
count_time = count_time + success_loop_time
print("Time: ", round(count_time) , "sec")

最后的结果:

Time:  103 sec

google read request: 77

然后这个错误显示


raise APIError(response)
gspread.exceptions.APIError: {
"error": {
"code": 429,
"message": "Quota exceeded for quota group 'ReadGroup' and limit 'Read requests per user per 100 seconds' of service 'sheets.googleapis.com' for consumer 'project_number:1001198111824'.",
"status": "RESOURCE_EXHAUSTED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developer console API key",
"url": "https://console.developers.google.com/project/1001198111824/apiui/credential"
}
]
}
]
}
}

但是我每 100 秒的限制配额读取请求是 500 enter image description here

你能帮我解决一下吗五天前我仍然运行这段代码没有错误

抱歉我的英语不好

最佳答案

请注意,除了每个项目每 100 秒 500 个请求的限制外,还有每个用户每 100 秒 100 个请求的限制,请参阅 here .

仅此并不能解释为什么您达到了每 103 秒 77 个读取请求的配额,

但也要记住:

  • 如果您不是管理员,您的管理员可能会将您的配额限制为每秒少于 100 个请求
  • 配额不仅适用于读取请求,还包括您可能同时拥有的其他请求(例如写入),以及后台运行的其他代码的请求。

关于python-3.x - "Quota exceeded for quota group ' ReadGroup ' and limit ' 每个用户每 100 秒服务 google api 的读取请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59575214/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com