retrievers

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BasicRetrieverName = "basic"
View Source
const RoutingRetrieverName = "routing"
View Source
const SubqueryRetrieverName = "subquery"

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicRetriever

type BasicRetriever struct {
	TopK int
}

func (*BasicRetriever) Name added in v0.1.9

func (r *BasicRetriever) Name() string

func (*BasicRetriever) Retrieve

func (r *BasicRetriever) Retrieve(ctx context.Context, store store.Store, query string, datasetID string) ([]vs.Document, error)

type Retriever

type Retriever interface {
	Retrieve(ctx context.Context, store store.Store, query string, datasetID string) ([]vs.Document, error)
	Name() string
}

func GetDefaultRetriever

func GetDefaultRetriever() Retriever

func GetRetriever

func GetRetriever(name string) (Retriever, error)

type RoutingRetriever added in v0.1.8

type RoutingRetriever struct {
	Model             llm.LLMConfig
	AvailableDatasets []string
	TopK              int
}

func (*RoutingRetriever) Name added in v0.1.9

func (r *RoutingRetriever) Name() string

func (*RoutingRetriever) Retrieve added in v0.1.8

func (r *RoutingRetriever) Retrieve(ctx context.Context, store store.Store, query string, datasetID string) ([]vs.Document, error)

type SubqueryRetriever added in v0.1.8

type SubqueryRetriever struct {
	Model llm.LLMConfig
	Limit int
	TopK  int
}

func (SubqueryRetriever) Name added in v0.1.9

func (s SubqueryRetriever) Name() string

func (SubqueryRetriever) Retrieve added in v0.1.8

func (s SubqueryRetriever) Retrieve(ctx context.Context, store store.Store, query string, datasetID string) ([]vs.Document, error)

Jump to

Keyboard shortcuts

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