mirror of
https://github.com/vxcontrol/langchaingo.git
synced 2026-08-24 21:31:28 -04:00
17 lines
534 B
Go
17 lines
534 B
Go
package documentloaders
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/vxcontrol/langchaingo/schema"
|
|
"github.com/vxcontrol/langchaingo/textsplitter"
|
|
)
|
|
|
|
// Loader is the interface for loading and splitting documents from a source.
|
|
type Loader interface {
|
|
// Load loads from a source and returns documents.
|
|
Load(ctx context.Context) ([]schema.Document, error)
|
|
// LoadAndSplit loads from a source and splits the documents using a text splitter.
|
|
LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]schema.Document, error)
|
|
}
|