Skip to content

Commit

Permalink
community[patch]: callback before yield for cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
subroy13 committed Sep 27, 2024
1 parent c6350d6 commit e6773ae
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ def _stream(
logger.debug(chunk)
raise e
if data is not None and "response" in data:
if run_manager:
run_manager.on_llm_new_token(data["response"])
yield GenerationChunk(text=data["response"])
if run_manager:
run_manager.on_llm_new_token(data["response"])
logger.debug("stream end")
self.streaming = original_steaming

Expand Down

0 comments on commit e6773ae

Please sign in to comment.