cache

package
v6.7.16 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SignatureCacheTTL is how long signatures are valid
	SignatureCacheTTL = 3 * time.Hour

	// SignatureTextHashLen is the length of the hash key (16 hex chars = 64-bit key space)
	SignatureTextHashLen = 16

	// MinValidSignatureLen is the minimum length for a signature to be considered valid
	MinValidSignatureLen = 50

	// SessionCleanupInterval controls how often stale sessions are purged
	SessionCleanupInterval = 10 * time.Minute
)

Variables

This section is empty.

Functions

func CacheSignature

func CacheSignature(modelName, text, signature string)

CacheSignature stores a thinking signature for a given session and text. Used for Claude models that require signed thinking blocks in multi-turn conversations.

func ClearSignatureCache

func ClearSignatureCache(sessionID string)

ClearSignatureCache clears signature cache for a specific session or all sessions.

func GetCachedSignature

func GetCachedSignature(modelName, text string) string

GetCachedSignature retrieves a cached signature for a given session and text. Returns empty string if not found or expired.

func GetModelGroup added in v6.7.15

func GetModelGroup(modelName string) string

func HasValidSignature

func HasValidSignature(modelName, signature string) bool

HasValidSignature checks if a signature is valid (non-empty and long enough)

Types

type SignatureEntry

type SignatureEntry struct {
	Signature string
	Timestamp time.Time
}

SignatureEntry holds a cached thinking signature with timestamp

Jump to

Keyboard shortcuts

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