Term Cleanup: Handle embedding generation errors like rate limits
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
調査の方向性
issue にはファイルやテストの名前が記載されていないため、まず embeddings を生成する cleanup フローを特定し、API レスポンスと rate-limit エラーが現在どのように処理されているかを確認する。一般的な API エラーが表示可能なメッセージとともに停止し、rate-limit レスポンスについては上限のある backoff で再試行するか、最終的にエラーで停止することを、両方のパスのテストで裏付けられれば完了とする。
索引モデルが issue の本文から書いたものです。
説明
Is your enhancement related to a problem? Please describe.
Originally documented by @dkotter:
I didn't run into any errors when testing but in looking at the code, it doesn't seem we ever look at the response from generating an embedding.
So in a scenario where this API request fails, we just continue on to the next term. Think of a situation where the API goes down or we hit rate limits on the API. In that case, the process will continue to try forever even though we aren't getting any results from the API.
I'd suggest, if easy enough, two different approaches:
- If we get just a general error response from the API (i.e. the API is down), I think we should show that error message and stop the process from continuing
- If we get a rate limit error, ideally we would pause for a minute or two before proceeding and then try again. If it fails again with a rate limit error, maybe increase our pause by a couple minutes. Once we've tried this a few times, we can then output an error and stop the process. So basically an automatic retry mechanism with a built-in backoff mechanic to try and handle rate limit issues.
Note this last piece may be overkill for this so we can discuss whether it's worth the effort or not.
Designs
Originally documented by @dkotter:
Note that OpenAI exposes some headers around rate limits that would be interesting to use: https://platform.openai.com/docs/guides/rate-limits/rate-limits-in-headers
They also provide some examples (in python) on how to build an exponential backoff system: https://platform.openai.com/docs/guides/rate-limits/retrying-with-exponential-backoff
Describe alternatives you've considered
Originally reported via https://github.com/10up/classifai-cleanup/issues/3
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要言語
- PHP
- スター
- 714
- フォーク
- 68
- 平均マージ
- 4時間 32分
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
10up/classifai のほかの issue
-
wpvc
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
wpvc
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
Register ClassifAI functionality with the Abilities API対応中かも @nhrrob が 10 日前に担当しました。 オープンhelp wanted
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
10up/classifai#1249 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
OpenAI usage tracking: Project ID setting is ignored対応中かも @dajiaohuang が 30 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
BYOK Openai modelsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
firefly-iii/firefly-iii#13259 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
[Sync EN] Document the getLastErrors() return value change in the PHP 8.2 migration guide (#6107)オープンsync-en
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Перевод устарел
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信