[Update] Controller: Add methods for LMStudio and Ollama connection status checks

This commit is contained in:
misyaguziya
2025-11-24 18:01:30 +09:00
parent 8cc9255fd0
commit 9a35577ec6
6 changed files with 61 additions and 18 deletions

View File

@@ -7,15 +7,16 @@ try:
except Exception:
import sys
from os import path as os_path
sys.path.append(os_path.dirname(os_path.dirname(os_path.dirname(os_path.abspath(__file__)))))
from translation_languages import translation_lang
sys.path.append(os_path.dirname(os_path.abspath(__file__)))
from translation_languages import translation_lang, loadTranslationLanguages
from translation_utils import loadPromptConfig
loadTranslationLanguages(path=".", force=True)
def _authentication_check(base_url: str | None = None) -> bool:
"""Check authentication for Ollama API.
"""
try:
response = requests.get(f"{base_url}")
response = requests.get(f"{base_url}", timeout=0.2)
if response.status_code == 200:
return True
else: