mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-22 09:13:18 +03:00
fix: message attachment merge (#8498)
This commit is contained in:
parent
e7dcf63c77
commit
075cedabf7
@ -149,7 +149,17 @@ export class ChatSession implements AsyncDisposable {
|
||||
normalizedParams,
|
||||
this.config.sessionId
|
||||
);
|
||||
finished[0].attachments = firstMessage.attachments;
|
||||
|
||||
// attachments should be combined with the first user message
|
||||
const firstUserMessage =
|
||||
finished.find(m => m.role === 'user') || finished[0];
|
||||
firstUserMessage.attachments = [
|
||||
finished[0].attachments || [],
|
||||
firstMessage.attachments || [],
|
||||
]
|
||||
.flat()
|
||||
.filter(v => !!v?.trim());
|
||||
|
||||
return finished;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user