Documentation ¶
Overview ¶
Package documentloader provides functionality for loading and processing documents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSV ¶ added in v0.0.39
type CSV struct {
// contains filtered or unexported fields
}
CSV represents a CSV document loader.
func NewCSV ¶ added in v0.0.39
func NewCSV(r io.Reader, optFns ...func(o *CSVOptions)) *CSV
NewCSV creates a new CSV loader with an io.Reader and optional configuration options. It returns a pointer to the created CSV loader.
func (*CSV) LoadAndSplit ¶ added in v0.0.39
func (l *CSV) LoadAndSplit(ctx context.Context, splitter schema.TextSplitter) ([]schema.Document, error)
LoadAndSplit loads CSV documents from the provided reader and splits them using the specified text splitter.
type CSVOptions ¶ added in v0.0.41
type CSVOptions struct { // Separator is the rune used to separate fields in the CSV file. Separator rune // LazyQuotes controls whether the CSV reader should use lazy quotes mode. LazyQuotes bool // Columns is a list of column names to filter and include in the loaded documents. Columns []string }
CSVOptions contains options for configuring the CSV loader.
type Text ¶ added in v0.0.22
type Text struct {
// contains filtered or unexported fields
}
func (*Text) Load ¶ added in v0.0.22
Load reads the content from the reader and returns it as a single document.
func (*Text) LoadAndSplit ¶ added in v0.0.22
func (l *Text) LoadAndSplit(ctx context.Context, splitter schema.TextSplitter) ([]schema.Document, error)
LoadAndSplit reads the content from the reader and splits it into multiple documents using the provided splitter.
Click to show internal directories.
Click to hide internal directories.