storage

package
v0.0.0-...-99a752c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchModelInput

type FetchModelInput struct {
	UserID       string
	CollectionID string
}

type FetchNearestNeighborInput

type FetchNearestNeighborInput struct {
	UserID       string
	CollectionID string
	Vector       []float32
}

type Postgres

type Postgres struct{ *sqlx.DB }

func NewPostgres

func NewPostgres(dbConn *sqlx.DB) *Postgres

func (*Postgres) FetchModel

func (p *Postgres) FetchModel(ctx context.Context, in FetchModelInput) (string, error)

func (*Postgres) FetchNearestNeighbor

func (p *Postgres) FetchNearestNeighbor(ctx context.Context, in FetchNearestNeighborInput) (string, float64, error)

func (*Postgres) StoreEmbeddings

func (p *Postgres) StoreEmbeddings(ctx context.Context, in StoreEmbeddingInput) error

type StoreEmbeddingInput

type StoreEmbeddingInput struct {
	ID           string
	UserID       string
	CollectionID string
	Model        string
	Text         string
	Tokens       int64
	Vector       []float32
	CreatedAt    time.Time
}

Jump to

Keyboard shortcuts

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