Skip to content

Commit

Permalink
mistralai[patch]: 0.2.2 release (#28240)
Browse files Browse the repository at this point in the history
mistralai 0.2.2 release
  • Loading branch information
eyurtsev authored Nov 20, 2024
1 parent 1a66175 commit 2acc83f
Show file tree
Hide file tree
Showing 4 changed files with 343 additions and 311 deletions.
9 changes: 7 additions & 2 deletions libs/partners/mistralai/langchain_mistralai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,13 @@ def _convert_message_to_mistral_chat_message(
class ChatMistralAI(BaseChatModel):
"""A chat model that uses the MistralAI API."""

client: httpx.Client = Field(default=None, exclude=True) #: :meta private:
async_client: httpx.AsyncClient = Field(
# The type for client and async_client is ignored because the type is not
# an Optional after the model is initialized and the model_validator
# is run.
client: httpx.Client = Field( # type: ignore # : meta private:
default=None, exclude=True
)
async_client: httpx.AsyncClient = Field( # type: ignore # : meta private:
default=None, exclude=True
) #: :meta private:
mistral_api_key: Optional[SecretStr] = Field(
Expand Down
10 changes: 8 additions & 2 deletions libs/partners/mistralai/langchain_mistralai/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ class MistralAIEmbeddings(BaseModel, Embeddings):
[-0.009100092574954033, 0.005071679595857859, -0.0029193938244134188]
"""

client: httpx.Client = Field(default=None) #: :meta private:
async_client: httpx.AsyncClient = Field(default=None) #: :meta private:
# The type for client and async_client is ignored because the type is not
# an Optional after the model is initialized and the model_validator
# is run.
client: httpx.Client = Field(default=None) # type: ignore # : :meta private:

async_client: httpx.AsyncClient = Field( # type: ignore # : meta private:
default=None
)
mistral_api_key: SecretStr = Field(
alias="api_key",
default_factory=secret_from_env("MISTRAL_API_KEY", default=""),
Expand Down
Loading

0 comments on commit 2acc83f

Please sign in to comment.