app

package
v0.0.0-...-88a9a30 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCollectionName       string = "langchain"
	MetadataCollectionFieldName string = "collection_name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(ctx context.Context, cfg config.Config) *App

func (*App) GenerateFromParts

func (app *App) GenerateFromParts(ctx context.Context, prompts []string) (string, error)

func (*App) GenerateFromSinglePrompt

func (app *App) GenerateFromSinglePrompt(ctx context.Context, prompt string) (string, error)

func (*App) IndexFile

func (app *App) IndexFile(ctx context.Context, fileName string, contentReader *strings.Reader) error

func (*App) IndexSummaryForFile

func (app *App) IndexSummaryForFile(ctx context.Context, fileName string, contentReader *strings.Reader) error

func (*App) Search

func (app *App) Search(ctx context.Context, query string, numDocuments int, searchStrategy SearchStrategy) (model.SearchResults, error)

type SearchStrategy

type SearchStrategy int
const (
	// this strategy drives to search a top N of documents across <numberOfNamespacesToSearchIn> collections and selects a top N documents based on the score
	SearchStrategyTopFirst SearchStrategy = iota
	// this strategy drives to seach a top N of documents across <numberOfNamespacesToSearchIn> collections and selects top N/<numberOfNamespacesToSearchIn> from each
	SearchStrategyWide
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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