Skip to content

Commit

Permalink
community/chat_models/bedrock.py - added yield after callback
Browse files Browse the repository at this point in the history
  • Loading branch information
meenakshiruia committed Dec 25, 2024
1 parent 2a7469e commit 3d5514a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/community/langchain_community/chat_models/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ def _stream(
**kwargs,
):
delta = chunk.text
yield ChatGenerationChunk(message=AIMessageChunk(content=delta))
cg_chunk = ChatGenerationChunk(message=AIMessageChunk(content=delta))
if run_manager:
run_manager.on_llm_new_token(delta, chunk = cg_chunk )
yield cg_chunk

def _generate(
self,
Expand Down

0 comments on commit 3d5514a

Please sign in to comment.