Class●Since v0.1
Document
Bases
Constructors
Attributes
Methods
Inherited fromBaseMedia
Inherited fromSerializable
Attributes
lc_secrets
: dict[str, str]
—
A map of constructor argument names to secret ids.
constructor
__init__
Class for storing a piece of text and associated metadata.
Note
Document is for retrieval workflows, not chat I/O. For sending text
to an LLM in a conversation, use message types from langchain.messages.
Example:
from langchain_core.documents import Document
document = Document(
page_content="Hello, world!", metadata={"source": "https://example.com"}
)String text.
Return True as this class is serializable.
Get the namespace of the LangChain object.
