vectorstore

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChromemDB

type ChromemDB struct {
	// contains filtered or unexported fields
}

func NewChromemDB

func NewChromemDB(collection, path string, openaiClient *openai.Client, embeddingsModel string) (*ChromemDB, error)

func (*ChromemDB) Count

func (c *ChromemDB) Count() int

func (*ChromemDB) Reset

func (c *ChromemDB) Reset() error

func (*ChromemDB) Search

func (c *ChromemDB) Search(s string, similarEntries int) ([]string, error)

func (*ChromemDB) Store

func (c *ChromemDB) Store(s string) error

type DeleteRequest

type DeleteRequest struct {
	Keys [][]float32 `json:"keys"`
}

type FindRequest

type FindRequest struct {
	TopK int       `json:"topk"`
	Key  []float32 `json:"key"`
}

type FindResponse

type FindResponse struct {
	Keys         [][]float32 `json:"keys"`
	Values       []string    `json:"values"`
	Similarities []float32   `json:"similarities"`
}

type GetRequest

type GetRequest struct {
	Keys [][]float32 `json:"keys"`
}

type GetResponse

type GetResponse struct {
	Keys   [][]float32 `json:"keys"`
	Values []string    `json:"values"`
}

type LocalAIRAGDB

type LocalAIRAGDB struct {
	// contains filtered or unexported fields
}

func NewLocalAIRAGDB

func NewLocalAIRAGDB(storeClient *StoreClient, openaiClient *openai.Client) *LocalAIRAGDB

func (*LocalAIRAGDB) Count

func (db *LocalAIRAGDB) Count() int

func (*LocalAIRAGDB) Reset

func (db *LocalAIRAGDB) Reset() error

func (*LocalAIRAGDB) Search

func (db *LocalAIRAGDB) Search(s string, similarEntries int) ([]string, error)

func (*LocalAIRAGDB) Store

func (db *LocalAIRAGDB) Store(s string) error

type SetRequest

type SetRequest struct {
	Keys   [][]float32 `json:"keys"`
	Values []string    `json:"values"`
}

Define request and response struct formats based on the API documentation

type StoreClient

type StoreClient struct {
	BaseURL  string
	APIToken string
	Client   *http.Client
}

Define a struct to hold your store API client

func NewStoreClient

func NewStoreClient(baseUrl, apiToken string) *StoreClient

Constructor for StoreClient

func (*StoreClient) Delete

func (c *StoreClient) Delete(req DeleteRequest) error

Implement Delete method

func (*StoreClient) Find

func (c *StoreClient) Find(req FindRequest) (*FindResponse, error)

Implement Find method

func (*StoreClient) Get

func (c *StoreClient) Get(req GetRequest) (*GetResponse, error)

Implement Get method

func (*StoreClient) Set

func (c *StoreClient) Set(req SetRequest) error

Implement Set method

Jump to

Keyboard shortcuts

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