vector

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 8 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 {
	Host     string
	Port     string
	Database string
	User     string
	Password string
	SSLMode  string
}

func EnvConfig

func EnvConfig() *Config

type Service

type Service struct {
	DB        *sqlx.DB
	Table     string
	OpenAICli *openai.Client
}

func New

func New(ctx context.Context, table string, cli *openai.Client) (*Service, error)

func (*Service) Close

func (s *Service) Close()

func (*Service) GenerateEmbeddings

func (s *Service) GenerateEmbeddings(ctx context.Context, text string) ([]float64, error)

func (*Service) Query

func (s *Service) Query(ctx context.Context, input string) ([]string, error)

func (*Service) StoreEmbedding

func (s *Service) StoreEmbedding(ctx context.Context, text string, embedding []float64) error

func (*Service) Truncate

func (s *Service) Truncate(ctx context.Context) error

Jump to

Keyboard shortcuts

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