mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
c323742f4f
- **Description:** Adds MistralAIEmbeddings class for embeddings, using the new official API. - **Dependencies:** mistralai - **Tag maintainer**: @efriis, @hwchase17 - **Twitter handle:** @LMS_David_RS Create `integrations/text_embedding/mistralai.ipynb`: an example notebook for MistralAIEmbeddings class Modify `embeddings/__init__.py`: Import the class Create `embeddings/mistralai.py`: The embedding class Create `integration_tests/embeddings/test_mistralai.py`: The test file. --------- Co-authored-by: Erick Friis <erick@langchain.dev>
11 lines
223 B
Python
11 lines
223 B
Python
import os
|
|
|
|
from langchain_mistralai import MistralAIEmbeddings
|
|
|
|
os.environ["MISTRAL_API_KEY"] = "foo"
|
|
|
|
|
|
def test_mistral_init() -> None:
|
|
embeddings = MistralAIEmbeddings()
|
|
assert embeddings.model == "mistral-embed"
|