From 3ca78efdf066f1e6a039e39a77ba983823e4eeab Mon Sep 17 00:00:00 2001 From: Jerry Zhang Date: Thu, 14 Nov 2024 07:08:17 -0800 Subject: [PATCH] Deprecate gemini 1.0 pro (#725) * perf: deprecate gemini 1.0 pro * Update Easydict/Swift/Service/Gemini/GeminiService.swift --------- Co-authored-by: tisfeng --- Easydict/Swift/Service/Gemini/GeminiService.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Easydict/Swift/Service/Gemini/GeminiService.swift b/Easydict/Swift/Service/Gemini/GeminiService.swift index 9b74b20b7..4c113ac11 100644 --- a/Easydict/Swift/Service/Gemini/GeminiService.swift +++ b/Easydict/Swift/Service/Gemini/GeminiService.swift @@ -135,7 +135,7 @@ public final class GeminiService: LLMStreamService { var systemInstruction: ModelContent? = try ModelContent(role: "system", systemPrompt) // !!!: gemini-1.0-pro model does not support system instruction https://github.com/google-gemini/generative-ai-python/issues/328 - if model == GeminiModel.gemini_1_0_pro.rawValue { + if model == "gemini-1.0-pro" { systemInstruction = nil enableSystemPromptInChats = true } @@ -216,7 +216,6 @@ enum GeminiModel: String, CaseIterable { // RPM: Requests per minute, TPM: Tokens per minute // RPD: Requests per day, TPD: Tokens per day - case gemini_1_0_pro = "gemini-1.0-pro" // Free 15 RPM/32,000 TPM, 1,500 RPD/46,080,000 TPD (n/a context length) case gemini_1_5_flash = "gemini-1.5-flash" // Free 15 RPM/100million TPM, 1500 RPD/ n/a TPD (1048k context length) case gemini_1_5_pro = "gemini-1.5-pro" // Free 2 RPM/32,000 TPM, 50 RPD/46,080,000 TPD (1048k context length) case gemini_1_5_pro_exp_0801 = "gemini-1.5-pro-exp-0801" // Experimental