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

Method LoadAndSplit

documentloaders/csv.go:75–82  ·  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

73// LoadAndSplit reads text data from the io.Reader and splits it into multiple
74// documents using a text splitter.
75func (c CSV) LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]schema.Document, error) {
76 docs, err := c.Load(ctx)
77 if err != nil {
78 return nil, err
79 }
80
81 return textsplitter.SplitDocuments(splitter, docs)
82}

Callers

nothing calls this directly

Calls 2

LoadMethod · 0.95
SplitDocumentsFunction · 0.92

Tested by

no test coverage detected