feat: update prompt

This commit is contained in:
CaiHQ
2025-08-22 18:29:15 +08:00
parent e9fcbd36d4
commit 165140162a
2 changed files with 52 additions and 28 deletions

View File

@@ -109,7 +109,7 @@ export const getSystemPromptForWeb = async (
}
for (const key of Object.keys(iodSearchResults)) {
const arr = iodSearchResults[key]
_iodSearchResults[key] = arr.map((res) => ({
_iodSearchResults[key] = arr.data.map((res) => ({
doId: res.doId,
name: res.name,
url: res.url,
@@ -130,9 +130,8 @@ export const getSystemPromptForWeb = async (
])
// let search_results_iod = ""
debugger
let iod_search_results = Object.values(_iodSearchResults)
.map((item) => item.data)
.flat()
.map((result, idx) => {
const nameAttr = result.name ? ` name="${result.name}"` : ""
@@ -176,10 +175,11 @@ export const getSystemPromptForWeb = async (
}),
iodSources: iodSearchResults,
iodSearchResults: _iodSearchResults,
iodTokenCount: Object.values(_iodSearchResults)
.map((item) => item.data)
.flat()
.reduce((acc, cur) => acc + cur.content.length, 0)
iodTokenCount: 0
// Object.values(_iodSearchResults)
// .map((item) => item.data)
// .flat()
// .reduce((acc, cur) => acc + cur.content.length, 0)
}
} catch (e) {
console.error(e)