test_rate_limit_abatch() — langchain Function Reference
Architecture documentation for the test_rate_limit_abatch() function in test_rate_limiting.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 8da7cf2a_d987_88cf_1999_9af6192ad474["test_rate_limit_abatch()"] df01695c_1dbe_973d_756a_a5cd86e49330["test_rate_limiting.py"] 8da7cf2a_d987_88cf_1999_9af6192ad474 -->|defined in| df01695c_1dbe_973d_756a_a5cd86e49330 style 8da7cf2a_d987_88cf_1999_9af6192ad474 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/language_models/chat_models/test_rate_limiting.py lines 95–109
async def test_rate_limit_abatch() -> None:
"""Test that batch and stream calls work with rate limiters."""
model = GenericFakeChatModel(
messages=iter(["hello", "world", "!"]),
rate_limiter=InMemoryRateLimiter(
requests_per_second=20,
check_every_n_seconds=0.01,
max_bucket_size=10,
# At 20 requests per second we see a refresh every 0.05 seconds
),
)
tic = time.time()
await model.abatch(["foo", "foo"])
toc = time.time()
assert 0.1 < toc - tic < 0.2
Domain
Subdomains
Source
Frequently Asked Questions
What does test_rate_limit_abatch() do?
test_rate_limit_abatch() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/language_models/chat_models/test_rate_limiting.py.
Where is test_rate_limit_abatch() defined?
test_rate_limit_abatch() is defined in libs/core/tests/unit_tests/language_models/chat_models/test_rate_limiting.py at line 95.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free