langchain-mistralai
This package contains the LangChain integrations for MistralAI through their mistralai SDK.
Installation
pip install -U langchain-mistralai
Chat Models
This package contains the ChatMistralAI class, which is the recommended way to interface with MistralAI models.
To use, install the requirements, and configure your environment.
export MISTRAL_API_KEY=your-api-key
Then initialize
from langchain_core.messages import HumanMessage
from langchain_mistralai.chat_models import ChatMistralAI
chat = ChatMistralAI(model="mistral-small")
messages = [HumanMessage(content="say a brief hello")]
chat.invoke(messages)
ChatMistralAI also supports async and streaming functionality:
# For async...
await chat.ainvoke(messages)
# For streaming...
for chunk in chat.stream(messages):
print(chunk.content, end="", flush=True)
Metadata
Release files for langchain-mistralai 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_mistralai-0.0.2.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_mistralai-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / langchain_mistralai-0.0.2.tar.gz
| Download URL | langchain_mistralai-0.0.2.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e8396306b8f826d81b6e53e9f289770e440a80061aa3866d7039e26c450a2d1
|
|
BLAKE2b-256 checksum How to use checksums |
bac26c65ede51d9c50355be212fa55e478702e18fefc387761657de8dff53689
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / langchain_mistralai-0.0.2-py3-none-any.whl
| Download URL | langchain_mistralai-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
334ed39cf49642a0f6e93b8e8a3d178fff4ff325e6ffdeb44f38f3d065de0390
|
|
BLAKE2b-256 checksum How to use checksums |
ad91f12acd7e09fdfa31c238c9050f3da17e277984c4c4086f6d9e35d0b54f5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|