This commit is contained in:
Joseph Cheung 2023-03-01 14:06:43 +08:00
parent 925ef46e96
commit 86687a54a2
2 changed files with 32 additions and 32 deletions

View file

@ -1224,17 +1224,15 @@ function modal_open(url)
fetchRetry('https://search.kg/keytext',3,optkeytext) fetchRetry('https://search.kg/keytext',3,optkeytext)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
keytextres = data; keytextres = unique(data);
console.log(keytextres) console.log(keytextres)
}) promptWeb = '网页标题:'+ article.title +'\n'+'网页布局:\n'
promptWeb = '网页标题:'+ article.title +'\n'
for (el in modalele) for (el in modalele)
{ {
if((promptWeb + modalele[el] + '\n').length <400) if((promptWeb + modalele[el] + '\n').length <400)
promptWeb = promptWeb + modalele[el] + '\n'; promptWeb = promptWeb + modalele[el] + '\n';
} }
'网页布局:\n'+ modalele.slice(400) +'\n' +'网页内容:\n' promptWeb = promptWeb +'网页内容:\n'
keySentencesCount = 0; keySentencesCount = 0;
for (st in keytextres) for (st in keytextres)
{ {
@ -1243,6 +1241,8 @@ function modal_open(url)
keySentencesCount = keySentencesCount+1; keySentencesCount = keySentencesCount+1;
} }
console.log(promptWeb) console.log(promptWeb)
})
}, },
error => { error => {

View file

@ -1224,17 +1224,15 @@ function modal_open(url)
fetchRetry('https://search.kg/keytext',3,optkeytext) fetchRetry('https://search.kg/keytext',3,optkeytext)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
keytextres = data; keytextres = unique(data);
console.log(keytextres) console.log(keytextres)
}) promptWeb = '网页标题:'+ article.title +'\n'+'网页布局:\n'
promptWeb = '网页标题:'+ article.title +'\n'
for (el in modalele) for (el in modalele)
{ {
if((promptWeb + modalele[el] + '\n').length <400) if((promptWeb + modalele[el] + '\n').length <400)
promptWeb = promptWeb + modalele[el] + '\n'; promptWeb = promptWeb + modalele[el] + '\n';
} }
'网页布局:\n'+ modalele.slice(400) +'\n' +'网页内容:\n' promptWeb = promptWeb +'网页内容:\n'
keySentencesCount = 0; keySentencesCount = 0;
for (st in keytextres) for (st in keytextres)
{ {
@ -1243,6 +1241,8 @@ function modal_open(url)
keySentencesCount = keySentencesCount+1; keySentencesCount = keySentencesCount+1;
} }
console.log(promptWeb) console.log(promptWeb)
})
}, },
error => { error => {