-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Async callback for langchain #353
Conversation
Signed-off-by: Frost Ming <me@frostming.com>
Signed-off-by: Frost Ming <me@frostming.com>
|
||
async def on_llm_new_token(self, token: str, **kwargs: Any) -> None: | ||
if token is not None and token != "": | ||
print(token, end="") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems we need drop this print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, that is to display the text to console in stream mode. Intended.
All other bots have such prints, too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy that!
@dongjing007 can you also give a look? |
Signed-off-by: Frost Ming <me@frostming.com>
ok |
Asynchronous solutions are even more elegant and praiseworthy. 👍 @frostming @yihong0618 |
Yeah, we don't have to wait for the chain run complete to get the TTS. |
Signed-off-by: Frost Ming me@frostming.com