MCPcopy Create free account
hub / github.com/tmc/langchaingo / LoadAndSplit

Method LoadAndSplit

documentloaders/directory.go:154–160  ·  view source on GitHub ↗

LoadAndSplit loads from a source and splits the documents using a text splitter.

(ctx context.Context, splitter textsplitter.TextSplitter)

Source from the content-addressed store, hash-verified

152
153// LoadAndSplit loads from a source and splits the documents using a text splitter.
154func (l *RecursiveDirectoryLoader) LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]schema.Document, error) {
155 docs, err := l.Load(ctx)
156 if err != nil {
157 return nil, err
158 }
159 return textsplitter.SplitDocuments(splitter, docs)
160}

Callers

nothing calls this directly

Calls 2

LoadMethod · 0.95
SplitDocumentsFunction · 0.92

Tested by

no test coverage detected