cache

package
v0.5.24 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

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

	// MaxEntriesPerSession limits memory usage per session
	MaxEntriesPerSession = 100

	// 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
)

Variables

This section is empty.

Functions

func CacheSignature

func CacheSignature(sessionID, 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(sessionID, text string) string

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

func HasValidSignature

func HasValidSignature(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