refac: legacy support

This commit is contained in:
Timothy J. Baek 2024-10-04 16:56:20 -07:00
parent 2e267b420a
commit ee6e41b144

View File

@ -937,7 +937,26 @@
done: false done: false
} }
]; ];
files.push(...model.info.meta.knowledge); files.push(
...model.info.meta.knowledge.map((item) => {
if (item?.collection_name) {
return {
id: item.collection_name,
name: item.name,
legacy: true
};
} else if (item?.collection_names) {
return {
name: item.name,
type: 'collection',
collection_names: item.collection_names,
legacy: true
};
} else {
return item;
}
})
);
history.messages[responseMessageId] = responseMessage; history.messages[responseMessageId] = responseMessage;
} }
files.push( files.push(
@ -1243,7 +1262,26 @@
done: false done: false
} }
]; ];
files.push(...model.info.meta.knowledge); files.push(
...model.info.meta.knowledge.map((item) => {
if (item?.collection_name) {
return {
id: item.collection_name,
name: item.name,
legacy: true
};
} else if (item?.collection_names) {
return {
name: item.name,
type: 'collection',
collection_names: item.collection_names,
legacy: true
};
} else {
return item;
}
})
);
history.messages[responseMessageId] = responseMessage; history.messages[responseMessageId] = responseMessage;
} }
files.push( files.push(