mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 05:45:19 +00:00
fix: many model chat backward compatibility
This commit is contained in:
parent
8843898a8c
commit
bb026cdd9c
1 changed files with 12 additions and 2 deletions
|
|
@ -91,9 +91,19 @@
|
||||||
|
|
||||||
groupedMessages = parentMessage?.models.reduce((a, model, modelIdx) => {
|
groupedMessages = parentMessage?.models.reduce((a, model, modelIdx) => {
|
||||||
// Find all messages that are children of the parent message and have the same model
|
// 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])
|
.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 {
|
return {
|
||||||
...a,
|
...a,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue