community[patch]: callback before yield for _astream (gigachat) (#25834)

Description: Moves yield to after callback for _astream for gigachat in
the community package
Issue: #16913

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
Sam Jove
2024-08-29 09:29:28 -04:00
committed by GitHub
parent 703af9ffe3
commit bdce9a47d0

View File

@@ -268,6 +268,7 @@ class GigaChat(_BaseGigaChat, BaseChatModel):
dict(finish_reason=finish_reason) if finish_reason is not None else None
)
yield ChatGenerationChunk(message=chunk, generation_info=generation_info)
if run_manager:
await run_manager.on_llm_new_token(content)
yield ChatGenerationChunk(message=chunk, generation_info=generation_info)