Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

grayroom
Copy link

@grayroom grayroom commented Mar 24, 2025

  • 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

# Apply some jitter, plus-or-minus half a second.
jitter = 1 - 0.25 * random()
timeout = sleep_seconds * jitter
return timeout if timeout >= 0 else 0

  • 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 grayroom requested a review from a team as a code owner March 24, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant