-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mistralai[patch]: standardize model params (#20163)
Related to #20085
- Loading branch information
Showing
7 changed files
with
32 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 9 additions & 2 deletions
11
libs/partners/mistralai/tests/unit_tests/test_embeddings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import os | ||
from typing import cast | ||
|
||
from langchain_core.pydantic_v1 import SecretStr | ||
|
||
from langchain_mistralai import MistralAIEmbeddings | ||
|
||
os.environ["MISTRAL_API_KEY"] = "foo" | ||
|
||
|
||
def test_mistral_init() -> None: | ||
embeddings = MistralAIEmbeddings() | ||
assert embeddings.model == "mistral-embed" | ||
for model in [ | ||
MistralAIEmbeddings(model="mistral-embed", mistral_api_key="test"), | ||
MistralAIEmbeddings(model="mistral-embed", api_key="test"), | ||
]: | ||
assert model.model == "mistral-embed" | ||
assert cast(SecretStr, model.mistral_api_key).get_secret_value() == "test" |