翻訳APIの認証ロジックを改善し、YAMLファイルからプロンプト設定を読み込む機能を追加。新しいフォントファイルを追加し、データパスを更新。

This commit is contained in:
misyaguziya
2025-10-15 18:50:26 +09:00
parent 7d0f63c118
commit f8466bd6e4
15 changed files with 206 additions and 148 deletions

View File

@@ -66,14 +66,14 @@ class Translator:
result = False
return result
def authenticationPlamoAuthKey(self, auth_key: str, model: str) -> bool:
def authenticationPlamoAuthKey(self, auth_key: str, model: str, root_path: str = None) -> bool:
"""Authenticate Plamo API with the provided key.
Returns True on success, False on failure.
"""
result = True
try:
self.plamo_client = PlamoClient(auth_key, model=model)
self.plamo_client = PlamoClient(auth_key, model=model, root_path=root_path)
self.plamo_client.checkAuthKey()
except Exception:
errorLogging()
@@ -81,14 +81,14 @@ class Translator:
result = False
return result
def authenticationGeminiAuthKey(self, auth_key: str, model: str) -> bool:
def authenticationGeminiAuthKey(self, auth_key: str, model: str, root_path: str = None) -> bool:
"""Authenticate Gemini API with the provided key.
Returns True on success, False on failure.
"""
result = True
try:
self.gemini_client = GeminiClient(auth_key, model=model)
self.gemini_client = GeminiClient(auth_key, model=model, root_path=root_path)
self.gemini_client.checkAuthKey()
except Exception:
errorLogging()