cache

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheKey

func CacheKey(text, modelName, taskType string, dims int) string

CacheKey generates a deterministic key from text and embedding parameters.

Types

type Cache

type Cache interface {
	Get(key string) (model.Embedding, bool, error)
	Put(key string, emb model.Embedding) error
	Close() error
}

Cache provides get/put for embeddings keyed by content hash.

type JSONCache

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

JSONCache is a file-backed JSON cache.

func NewJSONCache

func NewJSONCache(path string) (*JSONCache, error)

func (*JSONCache) Close

func (c *JSONCache) Close() error

func (*JSONCache) Get

func (c *JSONCache) Get(key string) (model.Embedding, bool, error)

func (*JSONCache) Put

func (c *JSONCache) Put(key string, emb model.Embedding) error

Jump to

Keyboard shortcuts

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