rag

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Indexer added in v0.0.8

type Indexer struct {
	// contains filtered or unexported fields
}

Indexer ...

func NewIndexer added in v0.0.8

func NewIndexer(name string, config any) (*Indexer, error)

NewIndexer ...

func (*Indexer) Index added in v0.0.8

func (r *Indexer) Index(ctx context.Context, docs []*vdb.Document, opts *SearchOptions) ([]*vdb.Document, error)

func (*Indexer) Retrieve added in v0.0.8

func (r *Indexer) Retrieve(ctx context.Context, query string, opts ...SearchOption) ([]*vdb.Document, error)

Retrieve TODO: 实现检索逻辑

type Retrival added in v0.0.8

type Retrival struct {
	// contains filtered or unexported fields
}

Retrival ...

func NewRetrival added in v0.0.8

func NewRetrival(name string, config any) (*Retrival, error)

NewRetrival ...

func (*Retrival) Retrieve added in v0.0.8

func (r *Retrival) Retrieve(ctx context.Context, query string, opts *SearchOptions) ([]*vdb.Document, error)

Retrieve TODO: 实现检索逻辑

type ScalarDB

type ScalarDB interface {
	Fetch(context.Context, string, *SearchOptions) (*vdb.Document, error)
}

ScalarDB ...

type SearchOption added in v0.0.9

type SearchOption func(*SearchOptions)

func WithScoreThreshold added in v0.0.9

func WithScoreThreshold(scoreThreshold float64) SearchOption

func WithTopK added in v0.0.9

func WithTopK(topK int) SearchOption

type SearchOptions added in v0.0.9

type SearchOptions struct {
	LibraryID      int64   `json:"id"`
	Kind           string  `json:"kind"`
	IndexID        int32   `json:"index_id"`
	TopK           int     `json:"top_k"`
	ScoreThreshold float64 `json:"score_threshold"`
}

Options ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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