core: add sambanova chat models to load module mapping (#29855)

- **Description:** add sambanova integration package chat models to load
module mapping, to allow serialization and deserialization
This commit is contained in:
Jorge Piedrahita Ortiz 2025-02-20 12:30:50 -05:00 committed by GitHub
parent d227e4a08e
commit 3acf842e35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 0 deletions

View File

@ -112,6 +112,16 @@ def test_serializable_mapping() -> None:
"chat_models", "chat_models",
"ChatGroq", "ChatGroq",
), ),
("langchain_sambanova", "chat_models", "ChatSambaNovaCloud"): (
"langchain_sambanova",
"chat_models",
"ChatSambaNovaCloud",
),
("langchain_sambanova", "chat_models", "ChatSambaStudio"): (
"langchain_sambanova",
"chat_models",
"ChatSambaStudio",
),
# TODO(0.3): For now we're skipping the below two tests. Need to fix # TODO(0.3): For now we're skipping the below two tests. Need to fix
# so that it only runs when langchain-aws, langchain-google-genai # so that it only runs when langchain-aws, langchain-google-genai
# are installed. # are installed.

View File

@ -25,6 +25,7 @@ DEFAULT_NAMESPACES = [
"langchain_mistralai", "langchain_mistralai",
"langchain_fireworks", "langchain_fireworks",
"langchain_xai", "langchain_xai",
"langchain_sambanova",
] ]
# Namespaces for which only deserializing via the SERIALIZABLE_MAPPING is allowed. # Namespaces for which only deserializing via the SERIALIZABLE_MAPPING is allowed.
# Load by path is not allowed. # Load by path is not allowed.

View File

@ -528,6 +528,16 @@ SERIALIZABLE_MAPPING: dict[tuple[str, ...], tuple[str, ...]] = {
"structured", "structured",
"StructuredPrompt", "StructuredPrompt",
), ),
("langchain_sambanova", "chat_models", "ChatSambaNovaCloud"): (
"langchain_sambanova",
"chat_models",
"ChatSambaNovaCloud",
),
("langchain_sambanova", "chat_models", "ChatSambaStudio"): (
"langchain_sambanova",
"chat_models",
"ChatSambaStudio",
),
} }
# Needed for backwards compatibility for old versions of LangChain where things # Needed for backwards compatibility for old versions of LangChain where things