Skip to content

The agent engineering platform.

community[patch]: Invoke callback prior to yielding token (#18288)

William De Vena6b58943917f1
diff --git a/libs/community/langchain_community/llms/volcengine_maas.py b/libs/community/langchain_community/llms/volcengine_maas.py
index 444800e049..aa6a37cc2c 100644
--- a/libs/community/langchain_community/llms/volcengine_maas.py
+++ b/libs/community/langchain_community/llms/volcengine_maas.py
@@ -175,6 +175,6 @@ class VolcEngineMaasLLM(LLM, VolcEngineMaasBase):
chunk = GenerationChunk(
text=res.get("choice", {}).get("message", {}).get("content", "")
)
- yield chunk
if run_manager:
run_manager.on_llm_new_token(chunk.text, chunk=chunk)
+ yield chunk