feat: new endpoint-style structure in client side

NOT FINISHED. model menu and icon and send message not work.
This commit is contained in:
Wentao Lyu 2023-03-31 00:20:45 +08:00
parent dd825dc6d4
commit c53778e7c1
10 changed files with 172 additions and 243 deletions

View file

@ -0,0 +1,26 @@
import { atom, selector } from 'recoil';
const endpointsFilter = atom({
key: 'endpointsFilter',
default: {
azureOpenAI: false,
openAI: false,
bingAI: false,
chatGPTBrowser: false
}
});
const availableEndpoints = selector({
key: 'availableEndpoints',
get: ({ get }) => {
const endpoints = ['azureOpenAI', 'openAI', 'bingAI', 'chatGPTBrowser'];
const f = get(endpointsFilter);
return endpoints.filter(endpoint => f[endpoint]);
}
});
// const modelAvailable
export default {
endpointsFilter,
availableEndpoints
};