This commit is contained in:
Bagatur 2024-09-04 11:05:36 -07:00
parent 7bf54636ff
commit 576574c82c
4 changed files with 13 additions and 20 deletions

View File

@ -17,6 +17,7 @@ DEFAULT_NAMESPACES = [
"langchain_core",
"langchain_community",
"langchain_anthropic",
"langchain_groq",
]
ALL_SERIALIZABLE_MAPPINGS = {

View File

@ -271,6 +271,11 @@ SERIALIZABLE_MAPPING: Dict[Tuple[str, ...], Tuple[str, ...]] = {
"chat_models",
"ChatAnthropic",
),
("langchain_groq", "chat_models", "ChatGroq"): (
"langchain_groq",
"chat_models",
"ChatGroq"
),
("langchain", "chat_models", "fireworks", "ChatFireworks"): (
"langchain_fireworks",
"chat_models",
@ -287,6 +292,11 @@ SERIALIZABLE_MAPPING: Dict[Tuple[str, ...], Tuple[str, ...]] = {
"chat_models",
"ChatVertexAI",
),
("langchain", "chat_models", "mistralai", "ChatMistralAI"): (
"langchain_mistralai",
"chat_models",
"ChatMistralAI",
),
("langchain", "schema", "output", "ChatGenerationChunk"): (
"langchain_core",
"outputs",

View File

@ -359,8 +359,8 @@ def _convert_message_to_mistral_chat_message(
class ChatMistralAI(BaseChatModel):
"""A chat model that uses the MistralAI API."""
client: httpx.Client = Field(default=None) #: :meta private:
async_client: httpx.AsyncClient = Field(default=None) #: :meta private:
client: httpx.Client = Field(default=None, exclude=True) #: :meta private:
async_client: httpx.AsyncClient = Field(default=None, exclude=True) #: :meta private:
mistral_api_key: Optional[SecretStr] = Field(
alias="api_key",
default_factory=secret_from_env("MISTRAL_API_KEY", default=None),

View File

@ -45,24 +45,6 @@
'ChatMistralAI',
]),
'kwargs': dict({
'async_client': dict({
'id': list([
'httpx',
'AsyncClient',
]),
'lc': 1,
'repr': '<httpx.AsyncClient object at 0x1119d6990>',
'type': 'not_implemented',
}),
'client': dict({
'id': list([
'httpx',
'Client',
]),
'lc': 1,
'repr': '<httpx.Client object at 0x1119d3b90>',
'type': 'not_implemented',
}),
'endpoint': 'boo',
'max_concurrent_requests': 64,
'max_retries': 2,