Skip to content

The agent engineering platform.

community[patch]: callback before yield for friendli (#26842)

Subhrajyoty Royb61fb9846614
diff --git a/libs/community/langchain_community/llms/friendli.py b/libs/community/langchain_community/llms/friendli.py
index e6d13155cd..74b1ef7d19 100644
--- a/libs/community/langchain_community/llms/friendli.py
+++ b/libs/community/langchain_community/llms/friendli.py
@@ -233,9 +233,9 @@ class Friendli(LLM, BaseFriendli):
)
for line in stream:
chunk = _stream_response_to_generation_chunk(line)
- yield chunk
if run_manager:
run_manager.on_llm_new_token(line.text, chunk=chunk)
+ yield chunk
async def _astream(
self,
@@ -250,9 +250,9 @@ class Friendli(LLM, BaseFriendli):
)
async for line in stream:
chunk = _stream_response_to_generation_chunk(line)
- yield chunk
if run_manager:
await run_manager.on_llm_new_token(line.text, chunk=chunk)
+ yield chunk
def _generate(
self,