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

Method LoadAndSplit

documentloaders/text.go:44–51  ·  view source on GitHub ↗

LoadAndSplit reads text data from the io.Reader and splits it into multiple documents using a text splitter.

(ctx context.Context, splitter textsplitter.TextSplitter)

Source from the content-addressed store, hash-verified

42// LoadAndSplit reads text data from the io.Reader and splits it into multiple
43// documents using a text splitter.
44func (l Text) LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]schema.Document, error) {
45 docs, err := l.Load(ctx)
46 if err != nil {
47 return nil, err
48 }
49
50 return textsplitter.SplitDocuments(splitter, docs)
51}

Callers

nothing calls this directly

Calls 2

LoadMethod · 0.95
SplitDocumentsFunction · 0.92

Tested by

no test coverage detected