LoadAndSplit reads text data from the io.Reader and splits it into multiple documents using a text splitter.
(ctx context.Context, splitter textsplitter.TextSplitter)
| 42 | // LoadAndSplit reads text data from the io.Reader and splits it into multiple |
| 43 | // documents using a text splitter. |
| 44 | func (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 | } |
nothing calls this directly
no test coverage detected