LMStudio と Ollama の翻訳バックエンドを追加・統合。
- config: SELECTABLE_/SELECTED_ の LMStudio/Ollama 項目と LMSTUDIO_URL を追加。 - Controller: LMStudio/Ollama の認証チェック、URL取得/設定、モデル一覧取得/設定のエンドポイントを実装。 - Model/Translator: LMStudio/Ollama 用の認証・モデル一覧・モデル設定・クライアント更新メソッドを追加し、翻訳処理の選択肢に対応。 - translation_* クライアント: 各クライアントでのプロンプト読み込み処理を共通化し、translation_utils.loadPromptConfig を利用するようにリファクタ。 - translation_languages: LMStudio/Ollama 用の言語マッピングを追加。
This commit is contained in:
@@ -249,6 +249,38 @@ class Model:
|
||||
self.ensure_initialized()
|
||||
self.translator.updateOpenAIClient()
|
||||
|
||||
def authenticationTranslatorLMStudio(self, base_url: str) -> bool:
|
||||
result = self.translator.setLMStudioClientURL(base_url=base_url, root_path=config.PATH_LOCAL)
|
||||
return result
|
||||
|
||||
def getTranslatorLMStudioModelList(self) -> list[str]:
|
||||
self.ensure_initialized()
|
||||
return self.translator.getLMStudioModelList()
|
||||
|
||||
def setTranslatorLMStudioModel(self, model: str) -> bool:
|
||||
self.ensure_initialized()
|
||||
return self.translator.setLMStudioModel(model=model)
|
||||
|
||||
def updateTranslatorLMStudioClient(self) -> None:
|
||||
self.ensure_initialized()
|
||||
self.translator.updateLMStudioClient()
|
||||
|
||||
def authenticationTranslatorOllama(self) -> bool:
|
||||
result = self.translator.checkOllamaClient(root_path=config.PATH_LOCAL)
|
||||
return result
|
||||
|
||||
def getTranslatorOllamaModelList(self) -> list[str]:
|
||||
self.ensure_initialized()
|
||||
return self.translator.getOllamaModelList()
|
||||
|
||||
def setTranslatorOllamaModel(self, model: str) -> bool:
|
||||
self.ensure_initialized()
|
||||
return self.translator.setOllamaModel(model=model)
|
||||
|
||||
def updateTranslatorOllamaClient(self) -> None:
|
||||
self.ensure_initialized()
|
||||
self.translator.updateOllamaClient()
|
||||
|
||||
def startLogger(self):
|
||||
self.ensure_initialized()
|
||||
os_makedirs(config.PATH_LOGS, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user