cache

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemorySemanticCache

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

InMemorySemanticCache is a lightweight, concurrent-safe semantic cache. For production, this could be backed by Redis + Vector Search (like RedisVL).

func NewInMemorySemanticCache

func NewInMemorySemanticCache() *InMemorySemanticCache

func (*InMemorySemanticCache) Get

func (c *InMemorySemanticCache) Get(ctx context.Context, queryEmbedding []float32, threshold float32) (string, bool, error)

func (*InMemorySemanticCache) Set

func (c *InMemorySemanticCache) Set(ctx context.Context, queryEmbedding []float32, response string) error

Jump to

Keyboard shortcuts

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