core[patch]: doc init positional args (#16854)

This commit is contained in:
Bagatur
2024-02-02 10:24:16 -08:00
committed by GitHub
parent d80c612c92
commit 2a510c71a0
4 changed files with 13 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
from __future__ import annotations
from typing import List, Literal
from typing import Any, List, Literal
from langchain_core.load.serializable import Serializable
from langchain_core.pydantic_v1 import Field
@@ -17,6 +17,10 @@ class Document(Serializable):
"""
type: Literal["Document"] = "Document"
def __init__(self, page_content: str, **kwargs: Any) -> None:
"""Pass page_content in as positional or named arg."""
super().__init__(page_content=page_content, **kwargs)
@classmethod
def is_lc_serializable(cls) -> bool:
"""Return whether this class is serializable."""