config

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// OpenaiAPIKey a key to OpenAI API
	OpenaiAPIKey string

	// CohereAPIKey is a key to Cohere service
	CohereAPIKey string

	// BHLDir is the path to BHL items and OCRed texts.
	BHLDir string

	// LlmUtilURL is the URL to the llmutil service.
	LlmUtilURL string

	// QdrantHost is the host for creation qdrant grpc connection.
	QdrantHost string

	// QdrantSegmentsNum sets the number of segmens for Qdrant.
	QdrantSegmentsNum uint64

	// VectorSize sets the number of dimentions for embeding
	// vectors.
	VectorSize uint64

	// DbHost is the database host.
	DbHost string

	// DbUser is the username used to access the database.
	DbUser string

	// DbPass is the DbUser's password.
	DbPass string

	// DbBHLQuest is the database name where BHLquest keeps its data.
	DbBHLQuest string

	// DbBHLNames is the database where BHLnames keeps its data.
	DbBHLNames string

	// Port is the port where to run the RESTful service.
	Port int

	// APIDocURL is the url to the API documentation.
	APIDocURL string

	// InitClasses limits embedded import to certain taxa.
	InitClasses []string

	// InitTaxa limitd embedded import to main taxons of items.
	InitTaxa []string

	// ScoreThreshold filters out results with too low score.
	ScoreThreshold float64

	// MaxResultsNum limits the maximum number of results returned
	// in an answer.
	MaxResultsNum int

	// WithoutConfirm when true, remves confirmation dialogs.
	WithoutConfirm bool

	// WithSummary adds LLM-generated summary generated from
	// received BHL data.
	WithSummary bool

	// WithCrossEmbed flag controls use of Cross-Embed comparison
	// of a question with results.
	WithCrossEmbed bool
}

func New

func New(opts ...Option) Config

type Option

type Option func(*Config)

func OptBHLDir

func OptBHLDir(s string) Option

func OptCohereAPIKey added in v0.0.9

func OptCohereAPIKey(s string) Option

func OptDbBHLNames

func OptDbBHLNames(s string) Option

func OptDbBHLQuest

func OptDbBHLQuest(s string) Option

func OptDbHost

func OptDbHost(s string) Option

func OptDbPass

func OptDbPass(s string) Option

func OptDbUser

func OptDbUser(s string) Option

func OptInitClasses added in v0.0.2

func OptInitClasses(ss []string) Option

func OptInitTaxa added in v0.0.4

func OptInitTaxa(ss []string) Option

func OptLlmUtilURL

func OptLlmUtilURL(s string) Option

func OptMaxResultsNum added in v0.0.2

func OptMaxResultsNum(i int) Option

func OptOpenaiAPIKey added in v0.0.8

func OptOpenaiAPIKey(s string) Option

func OptPort added in v0.0.1

func OptPort(i int) Option

func OptQdrantHost added in v0.0.8

func OptQdrantHost(s string) Option

func OptScoreThreshold added in v0.0.2

func OptScoreThreshold(f float64) Option

func OptVectorSize added in v0.0.8

func OptVectorSize(i uint64) Option

func OptWithoutConfirm added in v0.0.2

func OptWithoutConfirm(b bool) Option

Jump to

Keyboard shortcuts

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