store

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 3 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 {
	Client     *chroma.Client
	Collection []Collection
}

func (*Chroma) Deinit

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

func (*Chroma) Init

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

func (*Chroma) Reset

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

func (*Chroma) Save

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

func (*Chroma) Search

func (c *Chroma) Search(_ context.Context, query string, limit int, threshold float64) ([]interface{}, error)

type Collection

type Collection struct {
	Id   []string
	Meta map[string]interface{}
	Text string
}

type Config

type Config struct {
	Provider string
	Api      string
	Token    string
}

func DefaultConfig

func DefaultConfig() *Config

type Ragx

type Ragx struct {
	Collection []Collection
}

func (*Ragx) Deinit

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

func (*Ragx) Init

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

func (*Ragx) Reset

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

func (*Ragx) Save

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

func (*Ragx) Search

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

type Store

type Store interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Reset(context.Context) error
	Save(context.Context, interface{}, map[string]interface{}, string) error
	Search(context.Context, string, int, float64) ([]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