翻訳バックエンドを拡張・リファクタリング:OpenAI/Plamo/Gemini クライアントを追加・改修し、プロンプトを YAML から読み込むように変更。各クライアントでモデル一覧取得・認証・クライアント更新機能を実装し、Translator/Model 層の対応メソッドを追加。Controller と mainloop にプラモ・ジェミニ・OpenAI の認証/モデル操作エンドポイントを追加・整備。config のモデル/API設定をプロパティ化して既定値を None に変更し、選択肢リストを初期化。translation_languages に OpenAI 用マッピングを追加。requirements ファイルの依存記述を調整。

This commit is contained in:
misyaguziya
2025-10-16 18:09:08 +09:00
parent f8466bd6e4
commit 526fd4d5aa
13 changed files with 842 additions and 337 deletions

View File

@@ -198,14 +198,57 @@ class Model:
result = self.translator.authenticationDeepLAuthKey(auth_key)
return result
def authenticationTranslatorPlamoAuthKey(self, auth_key: str, model: str) -> bool:
result = self.translator.authenticationPlamoAuthKey(auth_key, model=model, root_path=config.PATH_LOCAL)
def authenticationTranslatorPlamoAuthKey(self, auth_key: str) -> bool:
result = self.translator.authenticationPlamoAuthKey(auth_key, root_path=config.PATH_LOCAL)
return result
def authenticationTranslatorGeminiAuthKey(self, auth_key: str, model: str) -> bool:
result = self.translator.authenticationGeminiAuthKey(auth_key, model=model, root_path=config.PATH_LOCAL)
def getTranslatorPlamoModelList(self) -> list[str]:
self.ensure_initialized()
return self.translator.getPlamoModelList()
def setTranslatorPlamoModel(self, model: str) -> bool:
self.ensure_initialized()
result = self.translator.setPlamoModel(model=model)
return result
def updateTranslatorPlamoClient(self) -> None:
self.ensure_initialized()
self.translator.updatePlamoClient()
def authenticationTranslatorGeminiAuthKey(self, auth_key: str) -> bool:
result = self.translator.authenticationGeminiAuthKey(auth_key, root_path=config.PATH_LOCAL)
return result
def getTranslatorGeminiModelList(self) -> list[str]:
self.ensure_initialized()
return self.translator.getGeminiModelList()
def setTranslatorGeminiModel(self, model: str) -> bool:
self.ensure_initialized()
result = self.translator.setGeminiModel(model=model)
return result
def updateTranslatorGeminiClient(self) -> None:
self.ensure_initialized()
self.translator.updateGeminiClient()
def authenticationTranslatorOpenAIAuthKey(self, auth_key: str, base_url: Optional[str] = None) -> bool:
result = self.translator.authenticationOpenAIAuthKey(auth_key, base_url=base_url, root_path=config.PATH_LOCAL)
return result
def getTranslatorOpenAIModelList(self) -> list[str]:
self.ensure_initialized()
return self.translator.getOpenAIModelList()
def setTranslatorOpenAiModel(self, model: str) -> bool:
self.ensure_initialized()
result = self.translator.setOpenAIModel(model=model)
return result
def updateTranslatorOpenAIClient(self) -> None:
self.ensure_initialized()
self.translator.updateOpenAIClient()
def startLogger(self):
self.ensure_initialized()
os_makedirs(config.PATH_LOGS, exist_ok=True)