Skip to content

Commit

Permalink
fix: Clear assistant session redundant information (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
zgqgit authored Nov 29, 2024
2 parents 988ff95 + 4152b73 commit cef0591
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ const handleHistoryMsg = (data: any[]): ChatMessageType[] => {
.replace(/\r/g, '\\r') // 转义回车符
.replace(/\t/g, '\\t') // 转义制表符
.replace(/'/g, '"'); // 将单引号替换为双引号
return data.map(item => {
const newData = data.filter(item =>
['answer', 'question', 'processing', 'system', 'report', 'tool', 'knowledge', 'divider', 'flow'].includes(item.category)
)
return newData.map(item => {
// let count = 0
let { message, files, is_bot, intermediate_steps, ...other } = item
try {
Expand Down

0 comments on commit cef0591

Please sign in to comment.