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

Method LoadAndSplit

documentloaders/html.go:53–59  ·  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

51// LoadAndSplit reads text data from the io.Reader and splits it into multiple
52// documents using a text splitter.
53func (h HTML) LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]schema.Document, error) {
54 docs, err := h.Load(ctx)
55 if err != nil {
56 return nil, err
57 }
58 return textsplitter.SplitDocuments(splitter, docs)
59}

Callers

nothing calls this directly

Calls 2

LoadMethod · 0.95
SplitDocumentsFunction · 0.92

Tested by

no test coverage detected