Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kemingy
Copy link
Member

@kemingy kemingy commented Jul 3, 2025

@kemingy kemingy requested a review from Copilot July 3, 2025 07:52
@kemingy kemingy marked this pull request as ready for review July 3, 2025 07:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a configurable rate-limiting transport for HTTPX to throttle Gemini API requests

  • Introduces RateLimitTransport in utils.py to enforce a max requests-per-second interval
  • Updates multiple clients (extract, evaluate, entity, chunk, augment) to use the new transport
  • Sets specific rate limits per component (16 rps for most calls, 1 rps for paid-tier embeddings)

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vechord/utils.py New RateLimitTransport class implements per-second throttling
vechord/extract.py Injects rate-limited transport into the HTML parser client
vechord/evaluate.py Applies rate-limited transport in evaluator HTTP client
vechord/entity.py Adds rate-limited transport to entity recognizer client
vechord/embedding.py Uses slower limit for paid-tier embeddings
vechord/chunk.py Throttles chunking client with rate limit
vechord/augment.py Integrates rate-limited transport into augmenter client
Comments suppressed due to low confidence (2)

vechord/embedding.py:95

  • The comment miscalculates the conversion: 10 RPM equals approximately 0.1667 rps, not 0.1 rps. Please update the comment to reflect the correct rate.
            # Paid Tier only has 10 RPM, this should be set to 0.1, but it's too slow

vechord/utils.py:14

  • There are no unit tests covering RateLimitTransport timing behavior. Adding tests to validate the interval enforcement and request spacing would help catch regressions.
class RateLimitTransport(httpx.AsyncHTTPTransport):

Signed-off-by: Keming <[email protected]>
@kemingy kemingy merged commit 776d810 into tensorchord:main Jul 3, 2025
4 checks passed
@kemingy kemingy deleted the gemini_rate_limit branch July 3, 2025 08:09
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