Skip to content

Use appropriate wait time for retry based on the error message.  #14

@ekzhu

Description

@ekzhu
[flaml.autogen.oai.completion: 05-11 00:50:35] {217} INFO - retrying in 10 seconds...
Traceback (most recent call last):
  File "[...\.venv\Lib\site-packages\flaml\autogen\oai\completion.py]", line 193, in _get_response
    response = openai_completion.create(request_timeout=request_timeout, **config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[...\.venv\Lib\site-packages\openai\api_resources\completion.py]", line 25, in create
    return super().create(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[...\.venv\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py]", line 153, in create
    response, _, api_key = requestor.request(
                           ^^^^^^^^^^^^^^^^^^
  File "[...\.venv\Lib\site-packages\openai\api_requestor.py]", line 226, in request
    resp, got_stream = self._interpret_response(result, stream)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[...\.venv\Lib\site-packages\openai\api_requestor.py]", line 620, in _interpret_response
    self._interpret_response_line(
  File "[...\.venv\Lib\site-packages\openai\api_requestor.py]", line 683, in _interpret_response_line
    raise self.handle_error_response(
openai.error.RateLimitError: Requests to the Completions_Create Operation under Azure OpenAI API version 2022-12-01 have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 59 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.
[flaml.autogen.oai.completion: 05-11 00:50:45] {217} INFO - retrying in 10 seconds...

The error message says "Please retry after 59 seconds", but FLAML keeps retrying in 10-second intervals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions