feat: re-orginazed three ask api. To provide ability to reproduce message.

feat: bing and sydney come to work again, [need more test]
This commit is contained in:
Wentao Lyu 2023-03-15 00:54:50 +08:00
parent 8b00805d24
commit 644f3f716f
5 changed files with 209 additions and 70 deletions

View file

@ -57,13 +57,16 @@ const getConvo = async (conversationId) => {
};
module.exports = {
saveConvo: async ({ conversationId, title, ...convo }) => {
saveConvo: async ({ conversationId, newConversationId, title, ...convo }) => {
try {
const messages = await getMessages({ conversationId });
const update = { ...convo, messages };
if (title) {
update.title = title;
}
if (newConversationId) {
update.conversationId = newConversationId;
}
if (!update.jailbreakConversationId)
update.jailbreakConversationId = null