Blocking sync code is used when using rate limiting in async code #26913
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
investigate
Flagged for investigation.
Checked other resources
Example Code
Not applicable as current code runs but is blocked by non async code.
Error Message and Stack Trace (if applicable)
N/A
Description
Async code is using sync (blocking code) when using rate limiting in two places:
In
BaseChatModel.astream()
:langchain/libs/core/langchain_core/language_models/chat_models.py
Lines 465 to 466 in 02f5962
In
BaseChatModel._agenerate_with_cache()
:langchain/libs/core/langchain_core/language_models/chat_models.py
Lines 907 to 908 in 02f5962
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: