Skip to main content

vtcode_config/constants/
prompt_cache.rs

1pub const DEFAULT_ENABLED: bool = true;
2pub const DEFAULT_CACHE_DIR: &str = ".vtcode/cache/prompts";
3pub const DEFAULT_MAX_ENTRIES: usize = 1_000;
4pub const DEFAULT_MAX_AGE_DAYS: u64 = 30;
5pub const DEFAULT_AUTO_CLEANUP: bool = true;
6pub const DEFAULT_MIN_QUALITY_THRESHOLD: f64 = 0.7;
7
8pub const OPENAI_MIN_PREFIX_TOKENS: u32 = 1_024;
9pub const GEMINI_MIN_PREFIX_TOKENS: u32 = 1_024;
10pub const OPENAI_IDLE_EXPIRATION_SECONDS: u64 = 60 * 60; // 1 hour max reuse window
11
12pub const ANTHROPIC_DEFAULT_TTL_SECONDS: u64 = 5 * 60; // 5 minutes
13pub const ANTHROPIC_EXTENDED_TTL_SECONDS: u64 = 60 * 60; // 1 hour option
14pub const ANTHROPIC_TOOLS_TTL_SECONDS: u64 = 60 * 60; // 1 hour for tools/system
15pub const ANTHROPIC_MESSAGES_TTL_SECONDS: u64 = 5 * 60; // 5 minutes for messages
16pub const ANTHROPIC_MAX_BREAKPOINTS: u8 = 4;
17pub const ANTHROPIC_MIN_MESSAGE_LENGTH_FOR_CACHE: usize = 256;
18
19pub const GEMINI_EXPLICIT_DEFAULT_TTL_SECONDS: u64 = 60 * 60; // 1 hour default for explicit caches
20
21pub const OPENROUTER_CACHE_DISCOUNT_ENABLED: bool = true;
22pub const XAI_CACHE_ENABLED: bool = true;
23pub const DEEPSEEK_CACHE_ENABLED: bool = true;
24pub const ZAI_CACHE_ENABLED: bool = false;
25pub const MOONSHOT_CACHE_ENABLED: bool = true;