feat: unify multimodels translation providers, remove self-hosting (Ollama/LibreTranslate), and fix local SQLite configuration
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m21s

This commit is contained in:
2026-06-14 10:44:46 +02:00
parent feea02033b
commit 5fd087979b
21 changed files with 157 additions and 1942 deletions

View File

@@ -73,6 +73,24 @@ class TranslationProvider(ABC):
"""
return [self.translate_text(req) for req in requests]
def translate(
self, text: str, target_language: str, source_language: str = "auto"
) -> str:
"""
Compatibility method for the legacy interface.
Translates a single text string synchronously.
"""
req = TranslationRequest(
text=text,
target_language=target_language,
source_language=source_language,
)
resp = self.translate_text(req)
if resp.error:
raise Exception(f"[{resp.error_code or 'UNKNOWN'}] {resp.error}")
return resp.translated_text
def health_check(self) -> ProviderHealthStatus:
"""
Return health status details for the provider.