mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-23 11:30:37 +00:00
core[patch]: Add an example to the Document schema doc-string (#23131)
Add an example to the document schema
This commit is contained in:
@@ -7,7 +7,19 @@ from langchain_core.pydantic_v1 import Field
|
||||
|
||||
|
||||
class Document(Serializable):
|
||||
"""Class for storing a piece of text and associated metadata."""
|
||||
"""Class for storing a piece of text and associated metadata.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from langchain_core.documents import Document
|
||||
|
||||
document = Document(
|
||||
page_content="Hello, world!",
|
||||
metadata={"source": "https://example.com"}
|
||||
)
|
||||
"""
|
||||
|
||||
page_content: str
|
||||
"""String text."""
|
||||
|
Reference in New Issue
Block a user