front and backend logic for model switching

This commit is contained in:
Daniel Avila 2023-02-13 21:15:28 -05:00
parent a5afd5c48f
commit c00a2c902b
9 changed files with 58 additions and 39 deletions

View file

@ -2,6 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';
const initialState = {
isSubmitting: false,
model: 'chatgpt'
};
const currentSlice = createSlice({
@ -11,9 +12,12 @@ const currentSlice = createSlice({
setSubmitState: (state, action) => {
state.isSubmitting = action.payload;
},
setModel: (state, action) => {
state.model = action.payload;
},
}
});
export const { setSubmitState } = currentSlice.actions;
export const { setSubmitState, setModel } = currentSlice.actions;
export default currentSlice.reducer;