types

package
v0.4.14-rc.16 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArchivePrefix = "archive://"
)

Variables

This section is empty.

Functions

func FromGolcDocs

func FromGolcDocs(docs []golcschema.Document) []vs.Document

func FromLangchainDocs

func FromLangchainDocs(docs []lcgoschema.Document) []vs.Document

func ToGolcDocs

func ToGolcDocs(docs []vs.Document) []golcschema.Document

func ToLangchainDocs

func ToLangchainDocs(docs []vs.Document) []lcgoschema.Document

Types

type DocumentLoader

type DocumentLoader interface {
	Load(ctx context.Context) ([]vs.Document, error)
	LoadAndSplit(ctx context.Context, splitter TextSplitter) ([]vs.Document, error)
}

type DocumentTransformer

type DocumentTransformer interface {
	Transform(context.Context, []vs.Document) ([]vs.Document, error)
	Name() string
}

type DocumentTransformerFunc

type DocumentTransformerFunc func(context.Context, []vs.Document) ([]vs.Document, error)

type Response added in v0.4.14

type Response struct {
	Query           string        `json:"subquery"`
	NumDocs         int           `json:"numResultDocuments"`
	ResultDocuments []vs.Document `json:"resultDocuments"`
}

type RetrievalResponse added in v0.1.9

type RetrievalResponse struct {
	Query     string     `json:"originalQuery"`
	Datasets  []string   `json:"queriedDatasets"`
	Responses []Response `json:"subqueryResults"`
}

type TextSplitter

type TextSplitter interface {
	SplitDocuments(docs []vs.Document) ([]vs.Document, error)
}

Jump to

Keyboard shortcuts

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