From 2556643996218d472fe4a84450f078200bb6deb8 Mon Sep 17 00:00:00 2001 From: tisfeng Date: Fri, 16 Feb 2024 10:52:33 +0800 Subject: [PATCH] perf: increase Gemini free quota to 100000 * 1000 --- Easydict/Feature/Service/Gemini/GeminiService.swift | 9 ++++----- Easydict/Feature/Service/Model/EZQueryService.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Easydict/Feature/Service/Gemini/GeminiService.swift b/Easydict/Feature/Service/Gemini/GeminiService.swift index 43331a553..2be848ec3 100644 --- a/Easydict/Feature/Service/Gemini/GeminiService.swift +++ b/Easydict/Feature/Service/Gemini/GeminiService.swift @@ -40,11 +40,6 @@ public final class GeminiService: QueryService { return orderedDict } - override public func ocr(_: EZQueryModel) async throws -> EZOCRResult { - NSLog("Gemini Translate does not support OCR") - throw QueryServiceError.notSupported - } - override public func needPrivateAPIKey() -> Bool { true } @@ -56,6 +51,10 @@ public final class GeminiService: QueryService { return true } + override public func totalFreeQueryCharacterCount() -> Int { + 100000 * 1000 + } + private let defaultAPIKey = "" /* .decryptAES() */ // easydict://writeKeyValue?EZGeminiAPIKey=xxx diff --git a/Easydict/Feature/Service/Model/EZQueryService.h b/Easydict/Feature/Service/Model/EZQueryService.h index f2616bfe4..c708b9806 100644 --- a/Easydict/Feature/Service/Model/EZQueryService.h +++ b/Easydict/Feature/Service/Model/EZQueryService.h @@ -114,6 +114,7 @@ NS_SWIFT_NAME(QueryService) - (BOOL)needPrivateAPIKey; +/// Default is 100 * 10000 - (NSInteger)totalFreeQueryCharacterCount; /// 获取文本的语言