Initial Commit
This commit is contained in:
BIN
app/services/__pycache__/translator.cpython-313.pyc
Normal file
BIN
app/services/__pycache__/translator.cpython-313.pyc
Normal file
Binary file not shown.
9
app/services/translator.py
Normal file
9
app/services/translator.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from app.core.deepseek_client import chat_with_openai
|
||||
|
||||
async def translate_text(text: str, target_language: str) -> str:
|
||||
messages = [
|
||||
{"role": "system", "content": f"Translate the following text into {target_language}. Output only the translated text without explanation."},
|
||||
{"role": "user", "content": text},
|
||||
]
|
||||
translated_text = await chat_with_openai(messages)
|
||||
return translated_text
|
||||
Reference in New Issue
Block a user