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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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