complete customGpt

This commit is contained in:
Daniel Avila 2023-03-04 20:48:59 -05:00
parent b4b0c123ba
commit d64f914552
9 changed files with 49 additions and 43 deletions

View file

@ -3,6 +3,7 @@ import RenameButton from './RenameButton';
import DeleteButton from './DeleteButton';
import { useDispatch } from 'react-redux';
import { setConversation } from '~/store/convoSlice';
import { setCustomGpt, setModel } from '~/store/submitSlice';
import { setMessages } from '~/store/messageSlice';
import { setText } from '~/store/textSlice';
import manualSWR from '~/utils/fetchers';
@ -15,7 +16,7 @@ export default function Conversation({
title = 'New conversation',
bingData,
chatGptLabel = null,
promptPrefix = null,
promptPrefix = null
}) {
const [renaming, setRenaming] = useState(false);
const [titleInput, setTitleInput] = useState(title);
@ -54,7 +55,15 @@ export default function Conversation({
);
}
const data = await trigger();
if (chatGptLabel) {
dispatch(setModel('chatgptCustom'));
} else {
dispatch(setModel(data[1].sender));
}
dispatch(setMessages(data));
dispatch(setCustomGpt(convo));
dispatch(setText(''));
};