complete customChatGpt model selection

This commit is contained in:
Danny Avila 2023-03-03 15:52:06 -05:00
parent 0f9cfd0395
commit 214228542a
18 changed files with 742 additions and 63 deletions

View file

@ -2,7 +2,10 @@ import { createSlice } from '@reduxjs/toolkit';
const initialState = {
isSubmitting: false,
model: 'bingai'
disabled: false,
model: 'chatgpt',
promptPrefix: '',
chatGptLabel: '',
};
const currentSlice = createSlice({
@ -12,12 +15,20 @@ const currentSlice = createSlice({
setSubmitState: (state, action) => {
state.isSubmitting = action.payload;
},
setDisabled: (state, action) => {
state.disabled = action.payload;
},
setModel: (state, action) => {
state.model = action.payload;
},
setCustomGpt: (state, action) => {
console.log('setCustomGpt', action.payload);
state.promptPrefix = action.payload.promptPrefix;
state.chatGptLabel = action.payload.chatGptLabel;
},
}
});
export const { setSubmitState, setModel } = currentSlice.actions;
export const { setSubmitState, setDisabled, setModel, setCustomGpt } = currentSlice.actions;
export default currentSlice.reducer;