10 lines
418 B
Python
10 lines
418 B
Python
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
|