Documentation ¶
Index ¶
- func AsGolc(loader types.DocumentLoader) golcschema.DocumentLoader
- func AsLangchain(loader types.DocumentLoader) lcgodocloaders.Loader
- func DefaultDocLoaderFunc(filetype string) func(ctx context.Context, reader io.Reader) ([]vs.Document, error)
- func FromGolc(loader golcschema.DocumentLoader) types.DocumentLoader
- func FromLangchain(loader lcgodocloaders.Loader) types.DocumentLoader
- func GetDocumentLoaderConfig(name string) (any, error)
- func WithConfig(config PDFOptions) func(o *PDFOptions)
- type LoaderFunc
- type PDF
- type PDFOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsGolc ¶
func AsGolc(loader types.DocumentLoader) golcschema.DocumentLoader
func AsLangchain ¶
func AsLangchain(loader types.DocumentLoader) lcgodocloaders.Loader
func DefaultDocLoaderFunc ¶
func FromGolc ¶
func FromGolc(loader golcschema.DocumentLoader) types.DocumentLoader
func FromLangchain ¶
func FromLangchain(loader lcgodocloaders.Loader) types.DocumentLoader
func GetDocumentLoaderConfig ¶
func WithConfig ¶
func WithConfig(config PDFOptions) func(o *PDFOptions)
WithConfig sets the PDF loader configuration.
Types ¶
type LoaderFunc ¶
func GetDocumentLoaderFunc ¶
func GetDocumentLoaderFunc(name string, config any) (LoaderFunc, error)
type PDF ¶
type PDF struct {
// contains filtered or unexported fields
}
PDF represents a PDF document loader that implements the DocumentLoader interface.
func NewPDF ¶
func NewPDF(r io.Reader, optFns ...func(o *PDFOptions)) (*PDF, error)
NewPDFFromFile creates a new PDF loader with the given options.
func (*PDF) Load ¶
Load loads the PDF document and returns a slice of vs.Document containing the page contents and metadata.
func (*PDF) LoadAndSplit ¶
LoadAndSplit loads PDF documents from the provided reader and splits them using the specified text splitter.
type PDFOptions ¶
type PDFOptions struct { // Password for encrypted PDF files. Password string // Page number to start loading from (default is 1). StartPage uint // Maximum number of pages to load (0 for all pages). MaxPages uint // Source is the name of the pdf document Source string // Number of goroutines to load pdf documents NumThread int }
Click to show internal directories.
Click to hide internal directories.