mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-22 18:42:48 +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,
|
normalizedParams,
|
||||||
this.config.sessionId
|
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;
|
return finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user