mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Link the checks into the code & made a basic news summary system
This commit is contained in:
parent
aea658a4cb
commit
f3204cb574
6 changed files with 51 additions and 20 deletions
|
@ -7,6 +7,8 @@ export default defineEventHandler(async (event) => {
|
|||
const host = getRequestHost(event);
|
||||
const protocol = getRequestProtocol(event);
|
||||
const slug = getRouterParam(event, "slug");
|
||||
const query = getQuery(event);
|
||||
const locale = query.locale;
|
||||
const buildURL = protocol + "://" + host + "/api/news/get/lt/" + slug;
|
||||
const data = await fetch(buildURL);
|
||||
const fetchNewsArticle = await data.json();
|
||||
|
@ -18,7 +20,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.`,
|
||||
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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue