forked from jupyterlab/jupyter-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for MistralAI (jupyterlab#823)
* Add support for MistralAI * embeddings * lint
- Loading branch information
Showing
5 changed files
with
39 additions
and
3 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
32 changes: 32 additions & 0 deletions
32
packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/mistralai.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from jupyter_ai_magics.providers import BaseProvider, EnvAuthStrategy | ||
from langchain_mistralai import ChatMistralAI, MistralAIEmbeddings | ||
|
||
from ..embedding_providers import BaseEmbeddingsProvider | ||
|
||
|
||
class MistralAIProvider(BaseProvider, ChatMistralAI): | ||
id = "mistralai" | ||
name = "MistralAI" | ||
models = [ | ||
"open-mistral-7b", | ||
"open-mixtral-8x7b", | ||
"open-mixtral-8x22b", | ||
"mistral-small-latest", | ||
"mistral-medium-latest", | ||
"mistral-large-latest", | ||
"codestral-latest", | ||
] | ||
model_id_key = "model" | ||
auth_strategy = EnvAuthStrategy(name="MISTRAL_API_KEY") | ||
pypi_package_deps = ["langchain-mistralai"] | ||
|
||
|
||
class MistralAIEmbeddingsProvider(BaseEmbeddingsProvider, MistralAIEmbeddings): | ||
id = "mistralai" | ||
name = "MistralAI" | ||
models = [ | ||
"mistral-embed", | ||
] | ||
model_id_key = "model" | ||
pypi_package_deps = ["langchain-mistralai"] | ||
auth_strategy = EnvAuthStrategy(name="MISTRAL_API_KEY") |
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