feat: update prompt
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user