mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
core[patch]: support JS message serial namespaces (#18151)
This commit is contained in:
parent
c673717c2b
commit
c53aa5cd37
@ -5,6 +5,7 @@ from typing import Any, Dict, List, Optional
|
||||
|
||||
from langchain_core._api import beta
|
||||
from langchain_core.load.mapping import (
|
||||
_JS_SERIALIZABLE_MAPPING,
|
||||
_OG_SERIALIZABLE_MAPPING,
|
||||
OLD_CORE_NAMESPACES_MAPPING,
|
||||
SERIALIZABLE_MAPPING,
|
||||
@ -17,6 +18,7 @@ ALL_SERIALIZABLE_MAPPINGS = {
|
||||
**SERIALIZABLE_MAPPING,
|
||||
**OLD_CORE_NAMESPACES_MAPPING,
|
||||
**_OG_SERIALIZABLE_MAPPING,
|
||||
**_JS_SERIALIZABLE_MAPPING,
|
||||
}
|
||||
|
||||
|
||||
|
@ -879,3 +879,90 @@ OLD_CORE_NAMESPACES_MAPPING: Dict[Tuple[str, ...], Tuple[str, ...]] = {
|
||||
"RunnableRetry",
|
||||
),
|
||||
}
|
||||
|
||||
_JS_SERIALIZABLE_MAPPING: Dict[Tuple[str, ...], Tuple[str, ...]] = {
|
||||
("langchain_core", "messages", "AIMessage"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"ai",
|
||||
"AIMessage",
|
||||
),
|
||||
("langchain_core", "messages", "AIMessageChunk"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"ai",
|
||||
"AIMessageChunk",
|
||||
),
|
||||
("langchain_core", "messages", "BaseMessage"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"base",
|
||||
"BaseMessage",
|
||||
),
|
||||
("langchain_core", "messages", "BaseMessageChunk"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"base",
|
||||
"BaseMessageChunk",
|
||||
),
|
||||
("langchain_core", "messages", "ChatMessage"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"chat",
|
||||
"ChatMessage",
|
||||
),
|
||||
("langchain_core", "messages", "ChatMessageChunk"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"chat",
|
||||
"ChatMessageChunk",
|
||||
),
|
||||
("langchain_core", "messages", "FunctionMessage"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"function",
|
||||
"FunctionMessage",
|
||||
),
|
||||
("langchain_core", "messages", "FunctionMessageChunk"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"function",
|
||||
"FunctionMessageChunk",
|
||||
),
|
||||
("langchain_core", "messages", "HumanMessage"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"human",
|
||||
"HumanMessage",
|
||||
),
|
||||
("langchain_core", "messages", "HumanMessageChunk"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"human",
|
||||
"HumanMessageChunk",
|
||||
),
|
||||
("langchain_core", "messages", "SystemMessage"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"system",
|
||||
"SystemMessage",
|
||||
),
|
||||
("langchain_core", "messages", "SystemMessageChunk"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"system",
|
||||
"SystemMessageChunk",
|
||||
),
|
||||
("langchain_core", "messages", "ToolMessage"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"tool",
|
||||
"ToolMessage",
|
||||
),
|
||||
("langchain_core", "messages", "ToolMessageChunk"): (
|
||||
"langchain_core",
|
||||
"messages",
|
||||
"tool",
|
||||
"ToolMessageChunk",
|
||||
),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user