refactor: update cached content test body to meet token requirements and change model to lite

main
Yoo1tic 2025-08-11 19:26:09 +08:00
parent 5e1226a2b5
commit ee5b9739a4
1 changed files with 5 additions and 3 deletions

View File

@ -64,10 +64,12 @@ pub static GENERATE_CONTENT_TEST_BODY: LazyLock<Value> = LazyLock::new(|| {
// LazyLock for the cached content test body used in cache API validation
pub static CACHE_CONTENT_TEST_BODY: LazyLock<GeminiRequest> = LazyLock::new(|| {
// Generate random text content to meet the minimum 1024 tokens requirement for cache API
let long_text = "You are an expert at analyzing transcripts.".repeat(150);
// Generate random text content to meet the minimum 2048 tokens requirement for cache API
// models/gemini-2.5-flash need 1024 tokens
// models/gemini-2.5-flash-lite need 2048 tokens
let long_text = "You are an expert at analyzing transcripts.".repeat(260);
GeminiRequest {
model: Some("models/gemini-2.5-flash".to_string()),
model: Some("models/gemini-2.5-flash-lite".to_string()),
contents: vec![ContentPart {
parts: vec![TextPart { text: long_text }],
role: Some("user".to_string()),