Skip to content

The agent engineering platform.

community[patch]: callback before yield for google palm (#26882)

Subhrajyoty Roy11e703a97e5d
diff --git a/libs/community/langchain_community/llms/google_palm.py b/libs/community/langchain_community/llms/google_palm.py
index 715792a3a0..1d1e62bf18 100644
--- a/libs/community/langchain_community/llms/google_palm.py
+++ b/libs/community/langchain_community/llms/google_palm.py
@@ -215,13 +215,13 @@ class GooglePalm(BaseLLM, BaseModel):
**kwargs,
):
chunk = GenerationChunk(text=stream_resp.text)
- yield chunk
if run_manager:
run_manager.on_llm_new_token(
stream_resp.text,
chunk=chunk,
verbose=self.verbose,
)
+ yield chunk
@property
def _llm_type(self) -> str: