textsplitter

package
v0.4.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsGolc

func AsGolc(splitter types.TextSplitter) golcschema.TextSplitter

func AsLangchain

func AsLangchain(splitter types.TextSplitter) lcgosplitter.TextSplitter

func DefaultTextSplitter

func DefaultTextSplitter(filetype string, textSplitterOpts *TextSplitterOpts) types.TextSplitter

func FromGolc

func FromGolc(splitter golcschema.TextSplitter) types.TextSplitter

func FromLangchain

func FromLangchain(splitter lcgosplitter.TextSplitter) types.TextSplitter

func GetTextSplitter added in v0.4.8

func GetTextSplitter(name string, config any) (dstypes.TextSplitter, error)

func GetTextSplitterConfig

func GetTextSplitterConfig(name string) (any, error)

func LangchainToNative

func LangchainToNative(splitter lcgosplitter.TextSplitter) types.TextSplitter

func NewLcgoTextSplitter

func NewLcgoTextSplitter(opts TextSplitterOpts) lcgosplitter.TokenSplitter

NewLcgoTextSplitter returns a new langchain-go text splitter.

Types

type SplitterFunc

type SplitterFunc func([]vs.Document) ([]vs.Document, error)

type TextSplitterOpts

type TextSplitterOpts struct {
	ChunkSize    int    `` /* 154-byte string literal not displayed */
	ChunkOverlap int    `` /* 168-byte string literal not displayed */
	ModelName    string `` /* 156-byte string literal not displayed */
	EncodingName string `` /* 176-byte string literal not displayed */
}

func NewTextSplitterOpts

func NewTextSplitterOpts() TextSplitterOpts

NewTextSplitterOpts returns the default options for a text splitter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL