mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 05:24:02 +00:00
fix: many model chat backward compatibility
This commit is contained in:
parent
8843898a8c
commit
bb026cdd9c
@ -91,9 +91,19 @@
|
||||
|
||||
groupedMessages = parentMessage?.models.reduce((a, model, modelIdx) => {
|
||||
// Find all messages that are children of the parent message and have the same model
|
||||
const modelMessages = parentMessage?.childrenIds
|
||||
let modelMessages = parentMessage?.childrenIds
|
||||
.map((id) => history.messages[id])
|
||||
.filter((m) => m.modelIdx === modelIdx);
|
||||
.filter((m) => m?.modelIdx === modelIdx);
|
||||
|
||||
if (modelMessages.length === 0) {
|
||||
modelMessages = parentMessage?.childrenIds
|
||||
.map((id) => history.messages[id])
|
||||
.filter((m) => m?.model === model);
|
||||
|
||||
modelMessages.forEach((m) => {
|
||||
m.modelIdx = modelIdx;
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
...a,
|
||||
|
Loading…
Reference in New Issue
Block a user