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.post1
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.post1.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_mistralai-0.0.2.post1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.0 kB
Release files / langchain_mistralai-0.0.2.post1.tar.gz
| Download URL | langchain_mistralai-0.0.2.post1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
485c9d2483536b9d48edcea54c74b6bd3227f5c3b9422ab7fa61fcfc935d1589
|
|
BLAKE2b-256 checksum How to use checksums |
26d4d7b907df10b72e5cbd3ed8c682fa1b399b43b65d5cdf0b3a0bb4baa83d90
|
| 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.post1-py3-none-any.whl
| Download URL | langchain_mistralai-0.0.2.post1-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c0005cc94e87f511d8631e67e310ff96091c3e0ee621949aa24cfeb02f02fce3
|
|
BLAKE2b-256 checksum How to use checksums |
03be3c7ac306673f7b699199a53e99ad47dc7b8d9f504e0114a2ec124310091e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|