documentloaders

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QACSV

type QACSV struct {
	// contains filtered or unexported fields
}

QACSV represents a QA CSV document loader.

func NewQACSV

func NewQACSV(r io.Reader, fileName string, questionColumn string, answerColumn string) QACSV

NewQACSV creates a new qa csv loader with an io.Reader and optional column names for filtering.

func (QACSV) Load

func (c QACSV) Load(_ context.Context) ([]schema.Document, error)

Load reads from the io.Reader and returns a single document with the data.

func (QACSV) LoadAndSplit

func (c QACSV) LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]schema.Document, error)

LoadAndSplit reads text data from the io.Reader and splits it into multiple documents using a text splitter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL