benjmor / tabroom_auto_summarize

Generates AI-powered summaries of meets from tabroom.com data
3 stars 1 forks source link

Handle throttling from OpenAI key use #27

Closed benjmor closed 8 months ago

benjmor commented 8 months ago

Maybe not a real issue since it only popped up when I first advertised this on Reddit (big traffic spike), but it's an edge case to consider.

RateLimitError

[ERROR] RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}
Traceback (most recent call last):
  File "/var/task/main.py", line 38, in handler
    response = tabroom_summary.main(
  File "/var/task/tabroom_summary/tabroom_summary.py", line 194, in main
    all_schools_dict = generate_chat_gpt_paragraphs(
  File "/var/task/tabroom_summary/generate_chat_gpt_paragraphs.py", line 115, in generate_chat_gpt_paragraphs
    client.chat.completions.create(
benjmor commented 8 months ago

This should be fixed with the combination of less traffic, Bedrock, and the individual-school-on-demand approach to generating results.