Skip to content

Commit

Permalink
fix: 修复context覆盖的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ikechan8370 committed Oct 25, 2023
1 parent b1e3fb7 commit e0f96e3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions utils/SydneyAIClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,8 @@ export default class SydneyAIClient {
}).join('\n')
context += '\n'
}
if (context) {
obj.arguments[0].previousMessages.push({
author: 'user',
description: context,
contextType: 'WebPage',
messageType: 'Context',
messageId: 'discover-web--page-ping-mriduna-----'
})
} else if (toSummaryFileContent?.content) {
if (toSummaryFileContent?.content) {
// 忽略context 不然可能会爆炸
obj.arguments[0].previousMessages.push({
author: 'user',
description: limitString(toSummaryFileContent?.content, 20000, true),
Expand All @@ -510,6 +503,14 @@ export default class SydneyAIClient {
// locale: 'und',
// privacy: 'Internal'
})
} else if (context) {
obj.arguments[0].previousMessages.push({
author: 'user',
description: context,
contextType: 'WebPage',
messageType: 'Context',
messageId: 'discover-web--page-ping-mriduna-----'
})
} else {
obj.arguments[0].previousMessages.push({
author: 'user',
Expand Down

0 comments on commit e0f96e3

Please sign in to comment.