This commit is contained in:
Bagatur
2024-08-19 15:08:41 -07:00
parent cb168ef981
commit 222ef967fa
3 changed files with 9 additions and 2 deletions

View File

@@ -102,6 +102,13 @@ def test_serializable_mapping() -> None:
"modifier",
"RemoveMessage",
),
# This is not exported from langchain, only langchain_core
("langchain_core", "prompts", "content_block", "ContentBlockPromptTemplate"): (
"langchain_core",
"prompts",
"content_block",
"ContentBlockPromptTemplate",
),
}
serializable_modules = import_all_modules("langchain")

View File

@@ -147,7 +147,7 @@ SERIALIZABLE_MAPPING: Dict[Tuple[str, ...], Tuple[str, ...]] = {
"image",
"ImagePromptTemplate",
),
("langchain", "prompts", "content_block", "ContentBlockPromptTemplate"): (
("langchain_core", "prompts", "content_block", "ContentBlockPromptTemplate"): (
"langchain_core",
"prompts",
"content_block",

View File

@@ -46,7 +46,7 @@ class ContentBlockPromptTemplate(BasePromptTemplate[Dict[str, Any]]):
@classmethod
def get_lc_namespace(cls) -> List[str]:
"""Get the namespace of the langchain object."""
return ["langchain", "prompts", "content_block"]
return ["langchain_core", "prompts", "content_block"]
def format(self, **kwargs: Any) -> Dict[str, Any]:
"""Format the prompt with the inputs.