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;
7pub const DEFAULT_CACHE_FRIENDLY_PROMPT_SHAPING: bool = false;
8
9pub const OPENAI_MIN_PREFIX_TOKENS: u32 = 1_024;
10pub const GEMINI_MIN_PREFIX_TOKENS: u32 = 1_024;
11pub const OPENAI_IDLE_EXPIRATION_SECONDS: u64 = 60 * 60; // 1 hour max reuse window
12
13pub const ANTHROPIC_DEFAULT_TTL_SECONDS: u64 = 5 * 60; // 5 minutes
14pub const ANTHROPIC_EXTENDED_TTL_SECONDS: u64 = 60 * 60; // 1 hour option
15pub const ANTHROPIC_TOOLS_TTL_SECONDS: u64 = 60 * 60; // 1 hour for tools/system
16pub const ANTHROPIC_MESSAGES_TTL_SECONDS: u64 = 5 * 60; // 5 minutes for messages
17pub const ANTHROPIC_MAX_BREAKPOINTS: u8 = 4;
18pub const ANTHROPIC_MIN_MESSAGE_LENGTH_FOR_CACHE: usize = 256;
19
20pub const GEMINI_EXPLICIT_DEFAULT_TTL_SECONDS: u64 = 60 * 60; // 1 hour default for explicit caches
21
22pub const OPENROUTER_CACHE_DISCOUNT_ENABLED: bool = true;
23pub const XAI_CACHE_ENABLED: bool = true;
24pub const DEEPSEEK_CACHE_ENABLED: bool = true;
25pub const ZAI_CACHE_ENABLED: bool = false;
26pub const MOONSHOT_CACHE_ENABLED: bool = true;