Problem/Motivation
From time to time I get this error:
Drupal\ai\Exception\AiRequestErrorException: Error invoking model response: Your requests to text-embedding-ada-002 for text-embedding-ada-002 in Germany West Central have exceeded the call rate limit for your current OpenAI S0 pricing tier. This request was for Embeddings_Create under Azure OpenAI API version 2023-05-15. Please retry after 1 second. To increase your default rate limit, visit: ``https://aka.ms/oai/quotaincrease``. in Drupal\ai\Plugin\ProviderProxy->wrapperCall() (line 309 of /var/www/html/docroot/modules/contrib/ai/src/Plugin/ProviderProxy.php).
It seems that exception AiRateLimitException is not thrown, because it looks for 'Request too large' words in the message, but they are not in the message.
Steps to reproduce
Try to call the embeddings creation a lot of times during short period of time.
Proposed resolution
Change the search pattern for AiRateLimitException to 'have exceeded the call rate limit' or similar.
Issue fork ai_provider_azure-3557858
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
a.dmitriiev commentedComment #4
marcus_johansson commentedLooks good to me, getting merged.