You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/partners
Yannick Stephan 5b1de2ae93
mistralai: Fixed streaming in MistralAI with ainvoke and callbacks (#22000)
# Fix streaming in mistral with ainvoke 
- [x] **PR title**
- [x] **PR message**
- [x] **Add tests and docs**:
  1. [x] Added a test for the fixed integration.
2. [x] An example notebook showing its use. It lives in
`docs/docs/integrations` directory.
- [x] **Lint and test**: Ran `make format`, `make lint` and `make test`
from the root of the package(s) I've modified.

Hello 

* I Identified an issue in the mistral package where the callback
streaming (see on_llm_new_token) was not functioning correctly when the
streaming parameter was set to True and call with `ainvoke`.
* The root cause of the problem was the streaming not taking into
account. ( I think it's an oversight )
* To resolve the issue, I added the `streaming` attribut.
* Now, the callback with streaming works as expected when the streaming
parameter is set to True.

## How to reproduce

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

# Oberve on_llm_new_token
# Now, the callback is given as streaming tokens, before it was in grouped format.
```

Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
..
ai21 Small bug fixes (#23353) 3 months ago
airbyte airbyte[patch]: airbyte-cdk compatible pydantic versions (#21738) 4 months ago
anthropic standard-tests[patch]: add anthropic format integration test (#23717) 3 months ago
azure-dynamic-sessions partners: add lint docstrings for azure-dynamic-sessions/together modules (#23303) 3 months ago
chroma chroma[patch]: Release 0.1.2 (#23604) 3 months ago
couchbase couchbase: Add the initial version of Couchbase partner package (#22087) 4 months ago
exa multiple: releases with relaxed core dep (#21724) 4 months ago
fireworks fireworks[patch]: Release 0.1.4 (#23654) 3 months ago
groq groq[patch]: Release 0.1.6 (#23655) 3 months ago
huggingface [Community [HuggingFace]]: Small Fix for ChatHuggingFace. (#22925) 3 months ago
ibm ibm: Add support for Chat Models (#22979) 3 months ago
milvus milvus[patch]: Release 0.1.1 (#22499) 4 months ago
mistralai mistralai: Fixed streaming in MistralAI with ainvoke and callbacks (#22000) 3 months ago
mongodb LangChain-MongoDB: [Experimental] Driver-side index creation helper (#19359) 3 months ago
nomic nomic[patch]: Release 0.1.2 (#22561) 4 months ago
openai partners[azure]: fix having openai_api_base set for other packages (#22068) 3 months ago
pinecone pinecone: Fix multiprocessing issue in PineconeVectorStore (#22571) 3 months ago
prompty prompty: docstring (#23152) 3 months ago
qdrant qdrant[patch]: Use collection_exists API instead of exceptions (#22764) 3 months ago
robocorp robocorp: typo (#22509) 4 months ago
together partners: add lint docstrings for azure-dynamic-sessions/together modules (#23303) 3 months ago
upstage upstage: move to external repo (#22506) 3 months ago
voyageai partners: Remove unnecessary print from voyageai embeddings (#21865) 4 months ago