openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

docs(client): fix incorrect comment about timeout calculation.

Open grayroom opened this issue 8 months ago • 0 comments

  • [x] I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Existing annotations misrepresent code behavior; therefore, changed it to comment that correctly describes code behavior.

  • Details are explained below.

Additional context & links

AS-IS

https://github.com/openai/openai-python/blob/f66d2e6fdc51c4528c99bb25a8fbca6f9b9b872d/src/openai/_base_client.py#L706-L709

  • The jitter is a number in the range (0.75, 1] and is multiplied on sleep_secounds. Therefore, the description "Apply some jitter, plus-or-minus half a second." is incorrect.

Code Fix vs Comment Fix

By referring to the same functionality code in openai-node repo, we can infer that multiplying the jitter by sleep_second is the intended behavior, so I decided to revise comment.

grayroom avatar Mar 24 '25 10:03 grayroom