feat: create conversation at the beginning then return the userMessage

This commit is contained in:
Wentao Lyu 2023-03-13 13:11:53 +08:00
parent 5a409ccfa6
commit 8773878be2
6 changed files with 50 additions and 40 deletions

View file

@ -11,6 +11,7 @@ import ConvoIcon from '../svg/ConvoIcon';
export default function Conversation({
id,
model,
parentMessageId,
conversationId,
title = 'New conversation',
@ -76,12 +77,12 @@ export default function Conversation({
if (chatGptLabel) {
dispatch(setModel('chatgptCustom'));
} else {
dispatch(setModel(data[1].sender));
dispatch(setModel(model));
}
if (modelMap[data[1].sender.toLowerCase()]) {
console.log('sender', data[1].sender);
dispatch(setCustomModel(data[1].sender.toLowerCase()));
if (modelMap[model.toLowerCase()]) {
console.log('sender', model);
dispatch(setCustomModel(model.toLowerCase()));
} else {
dispatch(setCustomModel(null));
}