documentloaders

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QuestionCol     = "q"
	AnswerCol       = "a"
	FileNameCol     = "file_name"
	PageNumberCol   = "page_number"
	ChunkContentCol = "chunk_content"
	LineNumber      = "line_number"
	QAFileName      = "qafile_name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.2.0

type Option func(p *QACSV)

Option is a function type that can be used to modify the client.

func WithAnswerColumn added in v0.2.0

func WithAnswerColumn(s string) Option

func WithChunkContentColumn added in v0.2.0

func WithChunkContentColumn(s string) Option

func WithFileNameColumn added in v0.2.0

func WithFileNameColumn(s string) Option

func WithPageNumberColumn added in v0.2.0

func WithPageNumberColumn(s string) Option

func WithQuestionColumn added in v0.2.0

func WithQuestionColumn(s string) Option

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, opts ...Option) 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