db

package
v0.17.8 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalModusDbEngine *modusdb.Engine

Functions

func CloseModusDb added in v0.17.0

func CloseModusDb(ctx context.Context)

func DeleteCollectionText

func DeleteCollectionText(ctx context.Context, collectionName, namespace, key string) error

func DeleteCollectionTexts

func DeleteCollectionTexts(ctx context.Context, collectionName string) error

func DeleteCollectionVector

func DeleteCollectionVector(ctx context.Context, searchMethodName string, textId int64) error

func DeleteCollectionVectors

func DeleteCollectionVectors(ctx context.Context, collectionName, searchMethodName, namespace string) error

func GetTx

func GetTx(ctx context.Context) (pgx.Tx, error)

func GetUniqueNamespaces

func GetUniqueNamespaces(ctx context.Context, collectionName string) ([]string, error)

func InitModusDb added in v0.17.0

func InitModusDb(ctx context.Context)

func Initialize

func Initialize(ctx context.Context)

func QueryCollectionTextsFromCheckpoint

func QueryCollectionTextsFromCheckpoint(ctx context.Context, collection, namespace string, textCheckpointId int64) ([]int64, []string, []string, [][]string, error)

func QueryCollectionVectorsFromCheckpoint

func QueryCollectionVectorsFromCheckpoint(ctx context.Context, collectionName, searchMethodName, namespace string, vecCheckpointId int64) ([]int64, []int64, []string, [][]float32, error)

func Stop

func Stop(ctx context.Context)

func WithTx

func WithTx(ctx context.Context, fn func(pgx.Tx) error) error

func WriteCollectionText

func WriteCollectionText(ctx context.Context, collectionName, namespace, key, text string, labels []string) (id int64, err error)

func WriteCollectionTexts

func WriteCollectionTexts(ctx context.Context, collectionName, namespace string, keys, texts []string, labelsArr [][]string) ([]int64, error)

func WriteCollectionVector

func WriteCollectionVector(ctx context.Context, searchMethodName string, textId int64, vector []float32) (vectorId int64, key string, err error)

func WriteCollectionVectors

func WriteCollectionVectors(ctx context.Context, searchMethodName string, textIds []int64, vectors [][]float32) ([]int64, []string, error)

func WriteInferenceHistory

func WriteInferenceHistory(ctx context.Context, model *manifest.ModelInfo, input, output any, start, end time.Time)

func WriteInferenceHistoryToDB

func WriteInferenceHistoryToDB(ctx context.Context, batch []inferenceHistory)

func WritePluginInfo

func WritePluginInfo(ctx context.Context, plugin *plugins.Plugin)

Types

type Inference added in v0.17.0

type Inference struct {
	Gid        uint64 `json:"gid,omitempty"`
	Id         string `json:"id,omitempty" db:"constraint=unique"`
	ModelHash  string `json:"model_hash,omitempty"`
	Input      string `json:"input,omitempty"`
	Output     string `json:"output,omitempty"`
	StartedAt  string `json:"started_at,omitempty"`
	DurationMs int64  `json:"duration_ms,omitempty"`
	Function   string `json:"function,omitempty"`
	Plugin     Plugin `json:"plugin,omitempty"`
}

func QueryInferences added in v0.17.0

func QueryInferences(ctx context.Context) ([]Inference, error)

type Plugin added in v0.17.0

type Plugin struct {
	Gid        uint64 `json:"gid,omitempty"`
	Id         string `json:"id,omitempty" db:"constraint=unique"`
	Name       string `json:"name,omitempty"`
	Version    string `json:"version,omitempty"`
	Language   string `json:"language,omitempty"`
	SdkVersion string `json:"sdk_version,omitempty"`
	BuildId    string `json:"build_id,omitempty"`
	BuildTime  string `json:"build_time,omitempty"`
	GitRepo    string `json:"git_repo,omitempty"`
	GitCommit  string `json:"git_commit,omitempty"`
}

func QueryPlugins added in v0.17.0

func QueryPlugins(ctx context.Context) ([]Plugin, error)

Jump to

Keyboard shortcuts

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