@nomyx/assistant
Version:
A powerful assistant library and cli for your AI projects. works with Vertex AI (Claude and Gemini)
25 lines (21 loc) • 595 B
text/typescript
export interface CacheConfig {
type: 'memory' | 'redis' | 'semantic';
[key: string]: any;
}
export interface CacheEntry {
key: string;
value: any;
expiresAt?: number;
}
export interface CacheManager {
get(key: string): Promise<any>;
set(key: string, value: any, ttl?: number): Promise<void>;
delete(key: string): Promise<void>;
clear(): Promise<void>;
}
export interface SemanticCacheEntry extends CacheEntry {
embedding: number[];
}
export interface SemanticCacheManager extends CacheManager {
search(query: string, threshold: number): Promise<SemanticCacheEntry[]>;
}