documentloaders

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QustionCol the question column, which will be embedding
	QuestionCol = "q"
	// AnswerCol the answer column, will be added to qustionCol when use qachain and knowledgebase retriever
	AnswerCol = "a"
	// FileNameCol the file name column, will show in reference
	FileNameCol = "file_name"
	// PageNumberCol the page number column, will show in reference
	PageNumberCol = "page_number"
	// ChunkContentCol the chunk content column, will show in reference
	ChunkContentCol = "chunk_content"
	// LineNumber the qafile line number column,
	LineNumber = "line_number"
	// QAFileName the qafile name
	QAFileName = "qafile_name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioWithWhisper added in v0.2.1

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

AudioWithWhisper represents a audio using whisper document loader.

func NewAudoWithWhisper added in v0.2.1

func NewAudoWithWhisper(data []byte, fileName, language, output string, vadFilter bool) AudioWithWhisper

NewAudoWithWhisper creates a new audo loader with an io.Reader and optional column names for filtering.

func (AudioWithWhisper) CovertToText added in v0.2.1

func (aww AudioWithWhisper) CovertToText(ctx context.Context) (string, error)

input will be from the previous LLM

func (AudioWithWhisper) Load added in v0.2.1

func (aww AudioWithWhisper) Load(ctx context.Context) ([]schema.Document, error)

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

func (AudioWithWhisper) LoadAndSplit added in v0.2.1

func (aww AudioWithWhisper) 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.

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 PDF added in v0.2.1

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

func NewPDF added in v0.2.1

func NewPDF(r io.Reader, fileName string) *PDF

func (*PDF) Load added in v0.2.1

func (p *PDF) Load(ctx context.Context) ([]schema.Document, error)

func (*PDF) LoadAndSplit added in v0.2.1

func (p *PDF) LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]schema.Document, error)

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