store

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderChroma = "chroma"
	ProviderRagx   = "ragx"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chroma

type Chroma struct {
	Url string

	Client     *chroma.Client
	Collection *chroma.Collection
	RecordSet  *types.RecordSet
}

func (*Chroma) Deinit

func (c *Chroma) Deinit(_ context.Context) error

func (*Chroma) Init

func (c *Chroma) Init(ctx context.Context, name string) error

func (*Chroma) Reset

func (c *Chroma) Reset(ctx context.Context) error

func (*Chroma) Save

func (c *Chroma) Save(ctx context.Context, text string, meta map[string]interface{}, _ string) error

func (*Chroma) Search

func (c *Chroma) Search(ctx context.Context, query string, limit int32, threshold float32) ([]interface{}, error)

type Collection

type Collection struct {
	Id      string
	Meta    map[string]interface{}
	Context string
	Score   float32
}

type Config

type Config struct {
	Provider string
	Url      string
}

func DefaultConfig

func DefaultConfig() *Config

type Ragx

type Ragx struct {
	Url string
}

func (*Ragx) Deinit

func (r *Ragx) Deinit(_ context.Context) error

func (*Ragx) Init

func (r *Ragx) Init(_ context.Context, name string) error

func (*Ragx) Reset

func (r *Ragx) Reset(_ context.Context) error

func (*Ragx) Save

func (r *Ragx) Save(_ context.Context, text string, meta map[string]interface{}, agent string) error

func (*Ragx) Search

func (r *Ragx) Search(_ context.Context, query string, limit int32, threshold float32) ([]interface{}, error)

type Store

type Store interface {
	Init(context.Context, string) error
	Deinit(context.Context) error
	Reset(context.Context) error
	Save(context.Context, string, map[string]interface{}, string) error
	Search(context.Context, string, int32, float32) ([]interface{}, error)
}

func New

func New(_ context.Context, cfg *Config) Store

Jump to

Keyboard shortcuts

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