diff --git a/components/app/windows/newsView.vue b/components/app/windows/newsView.vue index 8b0fff2..fe9b454 100644 --- a/components/app/windows/newsView.vue +++ b/components/app/windows/newsView.vue @@ -88,7 +88,7 @@ const aiSummary = async () => { isGenerating.value = true; try { const req = await fetch( - `/api/ai/summarize/${slug}?lang=${String(locale.value)}`, + `/api/ai/summarize/${slug}?locale=${String(locale.value)}`, ); const reader = req.body?.getReader(); const decoder = new TextDecoder(); diff --git a/server/api/ai/summarize/[slug].ts b/server/api/ai/summarize/[slug].ts index 7ac2dc6..fca0869 100644 --- a/server/api/ai/summarize/[slug].ts +++ b/server/api/ai/summarize/[slug].ts @@ -38,7 +38,7 @@ export default defineEventHandler(async (event) => { }, { role: "system", - content: `You are a news summarizer. You will be given a news article and you will summarize it into a short paragraph. The user's current locale is ${locale.toString()} please use the correct language as the response.`, + content: `You are a news summarizer. You will be given a news article and you will summarize it into a short paragraph. The user's current locale is ${locale || "zh-tw"} please use the correct language as the response.`, }, ], model: "gemma2-9b-it",