mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-13 13:04:24 +01:00
feat: return endpoint config from server
This commit is contained in:
parent
b687ab30ed
commit
60be4f12b7
4 changed files with 25 additions and 13 deletions
|
|
@ -1,12 +1,23 @@
|
|||
import { atom, selector } from 'recoil';
|
||||
|
||||
const endpointsFilter = atom({
|
||||
key: 'endpointsFilter',
|
||||
const endpointsConfig = atom({
|
||||
key: 'endpointsConfig',
|
||||
default: {
|
||||
azureOpenAI: false,
|
||||
openAI: false,
|
||||
bingAI: false,
|
||||
chatGPTBrowser: false
|
||||
azureOpenAI: null,
|
||||
openAI: null,
|
||||
bingAI: null,
|
||||
chatGPTBrowser: null
|
||||
}
|
||||
});
|
||||
|
||||
const endpointsFilter = selector({
|
||||
key: 'endpointsFilter',
|
||||
get: ({ get }) => {
|
||||
const config = get(endpointsConfig) || {};
|
||||
|
||||
let filter = {};
|
||||
for (const key of Object.keys(config)) filter[key] = !!config[key];
|
||||
return filter;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -21,6 +32,7 @@ const availableEndpoints = selector({
|
|||
// const modelAvailable
|
||||
|
||||
export default {
|
||||
endpointsConfig,
|
||||
endpointsFilter,
|
||||
availableEndpoints
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue