fix: ensure custom params are not passed to non custom models

This commit is contained in:
Daniel Avila 2023-03-14 20:21:41 -04:00
parent 6e32f71565
commit 796d8031e8
10 changed files with 503 additions and 151 deletions

View file

@ -42,6 +42,8 @@ export default function Conversation({
dispatch(setEmptyMessage());
const convo = { title, error: false, conversationId: id, chatGptLabel, promptPrefix };
// debugging
console.log(model, chatGptLabel, promptPrefix);
if (bingData) {
const {
@ -77,17 +79,19 @@ export default function Conversation({
if (chatGptLabel) {
dispatch(setModel('chatgptCustom'));
dispatch(setCustomModel(chatGptLabel.toLowerCase()));
} else {
dispatch(setModel(model));
}
if (modelMap[model.toLowerCase()]) {
console.log('sender', model);
dispatch(setCustomModel(model.toLowerCase()));
} else {
dispatch(setCustomModel(null));
}
// if (modelMap[chatGptLabel.toLowerCase()]) {
// console.log('custom model', chatGptLabel);
// dispatch(setCustomModel(chatGptLabel.toLowerCase()));
// } else {
// dispatch(setCustomModel(null));
// }
dispatch(setMessages(data));
dispatch(setCustomGpt(convo));
dispatch(setText(''));