langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
95.09k stars 15.41k forks source link

Partners: Issues with `Streaming` and MistralAI `ainvoke` and `Callbacks` Not Working #22702

Closed YanSte closed 4 months ago

YanSte commented 5 months ago

Checked other resources

Example Code

from langchain_mistralai.chat_models import ChatMistralAI
chain = ChatMistralAI(streaming=True)
# Add a callback
chain.ainvoke(..)

# Before
# Oberve on_llm_new_token with callback
# That give the token in grouped format.

# With my pull request
# Oberve on_llm_new_token with callback
# Now, the callback is given as streaming tokens, before it was in grouped format.

Error Message and Stack Trace (if applicable)

No message.

Description

Hello

I did this Pull Request

I addressed this issue because the pull request I submitted a month ago has not received any attention. Additionally, the problem reappears in each new version.

Could you please review the pull request.

System Info

All system can reproduce.

YanSte commented 5 months ago

Up ?

YanSte commented 4 months ago

Merged ✌️