Documentation
¶
Overview ¶
Package documentloaders implements document loaders that turn various file formats into text documents, mirroring langchain's document_loaders module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Directory ¶
Directory loads all files of matching extensions under a directory recursively as individual documents.
type Document ¶
type Document struct {
// PageContent is the extracted text.
PageContent string
// Metadata holds source info such as the file path.
Metadata map[string]any
}
Document is a single loaded document.
type JSONLoader ¶
JSONLoader loads a JSON file. If the root is an array, each element becomes a document; TextContentPath selects the string field to use as page content.
type Loader ¶
type Loader interface {
// Load returns all documents.
Load(ctx context.Context) ([]Document, error)
}
Loader loads documents from a source.
type LoaderFunc ¶
LoaderFunc adapts a function into a Loader.
type Markdown ¶
type Markdown struct {
Path string
}
Markdown loads a markdown file, preserving its text.
Click to show internal directories.
Click to hide internal directories.