diff --git a/server/api/translate.ts b/server/api/translate.ts index 8289eb9..8139678 100644 --- a/server/api/translate.ts +++ b/server/api/translate.ts @@ -66,9 +66,11 @@ export default defineEventHandler(async (event) => { ? body.model : config.ollamamodel; - const prompt = `Translate the following text from ${body.source} to ${body.target}. Only output the translation, nothing else. + const prompt = `You are a professional ${body.source} to ${body.target} translator. Your goal is to accurately convey the meaning and nuances of the original ${body.source} text while adhering to {TARGET_LANG} grammar, vocabulary, and cultural sensitivities. + Produce only the ${body.target} translation, without any additional explanations or commentary. Please translate the following ${body.source} text into ${body.target}: -Text to translate: ${body.text}`; + + ${body.text}`; const ollamaRequest: OllamaRequest = { model,