Skip to content

Conversation

@hironow
Copy link
Contributor

@hironow hironow commented Mar 11, 2025

This pull request corrects minor typographical errors found in the documentation and inline comments to enhance readability and clarity.
There are no functional changes included in this update.

rm-openai
rm-openai previously approved these changes Mar 11, 2025
hironow added 2 commits March 12, 2025 10:11
# Conflicts: #	tests/docs/config.md #	tests/docs/guardrails.md #	tests/docs/tracing.md
@rm-openai rm-openai merged commit 3d24787 into openai:main Mar 12, 2025
5 checks passed
@hironow hironow deleted the hironow/chore-doc-type branch March 12, 2025 10:04
DIZ-admin pushed a commit to DIZ-admin/openai-agents-python that referenced this pull request Nov 18, 2025
Implemented comprehensive rate limiting: - Token Bucket algorithm for RPM and TPM limits - Separate buckets for requests/minute and tokens/minute - Automatic token refilling at constant rate - Graceful degradation with queuing when limits reached - Concurrent request limiting with semaphore Features: - Per-model rate limits (gpt-4o: 30K TPM, gpt-4o-mini: 200K TPM) - Automatic wait time calculation - Statistics tracking (throttle rate, wait times, etc.) - Thread-safe with asyncio locks - Context manager API for easy usage Integration: - Integrated into Vision API (_call_openai_vision_api_with_retry) - Automatic token estimation based on image and schema size - Added to DI container with lazy initialization - Global rate limiter registry for singleton pattern Benefits: - Prevents 429 rate limit errors from OpenAI - Automatic queuing instead of failing requests - Better resource utilization with concurrent limiting - Detailed metrics for monitoring and optimization - Configurable limits per model tier Tests: - 19 comprehensive unit tests for rate limiter - Test token bucket algorithm, refilling, wait times - Test concurrent request limiting - Test per-model configuration - All tests passing Resolves: openai#5 (HIGH priority) Impact: Eliminates rate limit errors and improves API reliability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants