The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
google-genai[patch]: Invoke callback prior to yielding token (#17092)
Sparsh Jaina2167614b768
diff --git a/libs/partners/google-genai/langchain_google_genai/chat_models.py b/libs/partners/google-genai/langchain_google_genai/chat_models.pyindex 2f0d35428d..b69ff5824f 100644--- a/libs/partners/google-genai/langchain_google_genai/chat_models.py+++ b/libs/partners/google-genai/langchain_google_genai/chat_models.py@@ -624,9 +624,9 @@ class ChatGoogleGenerativeAI(_BaseGoogleGenerativeAI, BaseChatModel):generation_t=ChatGenerationChunk,)gen = cast(ChatGenerationChunk, _chat_result.generations[0])- yield genif run_manager:run_manager.on_llm_new_token(gen.text)+ yield genasync def _astream(self,@@ -654,9 +654,9 @@ class ChatGoogleGenerativeAI(_BaseGoogleGenerativeAI, BaseChatModel):generation_t=ChatGenerationChunk,)gen = cast(ChatGenerationChunk, _chat_result.generations[0])- yield genif run_manager:await run_manager.on_llm_new_token(gen.text)+ yield gendef _prepare_chat(self,