rag

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fusion

type Fusion struct {
	RAG
	// contains filtered or unexported fields
}

func NewFusion

func NewFusion(index *index.Index, llm LLM) *Fusion

func (*Fusion) Retrieve

func (r *Fusion) Retrieve(ctx context.Context, query string) ([]string, error)

type LLM

type LLM interface {
	Generate(context.Context, *thread.Thread) error
}

type Loader

type Loader interface {
	LoadFromSource(context.Context, string) ([]document.Document, error)
}

type RAG

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

func New

func New(index *index.Index) *RAG

func (*RAG) AddDocuments

func (r *RAG) AddDocuments(ctx context.Context, documents ...document.Document) error

func (*RAG) AddSources

func (r *RAG) AddSources(ctx context.Context, sources ...string) error

func (*RAG) Retrieve

func (r *RAG) Retrieve(ctx context.Context, query string) ([]string, error)

func (*RAG) WithChunkOverlap

func (r *RAG) WithChunkOverlap(chunkOverlap uint) *RAG

func (*RAG) WithChunkSize

func (r *RAG) WithChunkSize(chunkSize uint) *RAG

func (*RAG) WithLoader

func (r *RAG) WithLoader(sourceRegexp *regexp.Regexp, loader Loader) *RAG

func (*RAG) WithTopK

func (r *RAG) WithTopK(topK uint) *RAG

Jump to

Keyboard shortcuts

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