The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Empty check before pop (#4929)
Junlin Zhou9242998db11b
diff --git a/langchain/callbacks/streaming_aiter.py b/langchain/callbacks/streaming_aiter.pyindex 47372dd9ed..cc66d9a406 100644--- a/langchain/callbacks/streaming_aiter.py+++ b/langchain/callbacks/streaming_aiter.py@@ -58,7 +58,8 @@ class AsyncIteratorCallbackHandler(AsyncCallbackHandler):)# Cancel the other task- other.pop().cancel()+ if other:+ other.pop().cancel()# Extract the value of the first completed tasktoken_or_done = cast(Union[str, Literal[True]], done.pop().result())