ORA / app /services /translation.py
Abdalkaderdev's picture
Initial ORA deployment
5e0532d
from app.services.llm import llm_service
from typing import List
class TranslationService:
PROMPT = """Compare the following Bible translations:
Verse reference: {reference}
Translations:
{translations}
Explain:
- Key wording differences
- What meaning is shared
- What remains ambiguous
Do not claim one translation is superior."""
async def compare(self, reference: str, translations: List[str]) -> str:
# In a real app, we would fetch the texts first, here we mock passing them
translations_text = "\n".join(translations) # Placeholder
prompt = self.PROMPT.format(reference=reference, translations=translations_text)
return await llm_service.generate_response(message="Compare these translations.", system_prompt=prompt)
translation_service = TranslationService()