mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-17 07:58:08 +01:00
* chore: remove all bing code * chore: remove bing code and auto-focus effects * chore: add back escapeRegExp helper function for regex special character handling * chore: remove deprecated fields from settings and conversation schema * fix: ensure default endpoint is set correctly in conversation setup * feat: add disableFocus option to newConversation for improved search behavior
55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
import { atom, selector } from 'recoil';
|
|
import { EModelEndpoint } from 'librechat-data-provider';
|
|
import type { TEndpointsConfig } from 'librechat-data-provider';
|
|
|
|
const defaultConfig: TEndpointsConfig = {
|
|
[EModelEndpoint.azureOpenAI]: null,
|
|
[EModelEndpoint.azureAssistants]: null,
|
|
[EModelEndpoint.assistants]: null,
|
|
[EModelEndpoint.agents]: null,
|
|
[EModelEndpoint.openAI]: null,
|
|
[EModelEndpoint.chatGPTBrowser]: null,
|
|
[EModelEndpoint.gptPlugins]: null,
|
|
[EModelEndpoint.google]: null,
|
|
[EModelEndpoint.anthropic]: null,
|
|
[EModelEndpoint.custom]: null,
|
|
};
|
|
|
|
const endpointsConfig = atom<TEndpointsConfig>({
|
|
key: 'endpointsConfig',
|
|
default: defaultConfig,
|
|
});
|
|
|
|
const endpointsQueryEnabled = atom<boolean>({
|
|
key: 'endpointsQueryEnabled',
|
|
default: true,
|
|
});
|
|
|
|
const plugins = selector({
|
|
key: 'plugins',
|
|
get: ({ get }) => {
|
|
const config = get(endpointsConfig) || {};
|
|
return config.gptPlugins?.plugins || {};
|
|
},
|
|
});
|
|
|
|
const endpointsFilter = selector({
|
|
key: 'endpointsFilter',
|
|
get: ({ get }) => {
|
|
const config = get(endpointsConfig) || {};
|
|
|
|
const filter = {};
|
|
for (const key of Object.keys(config)) {
|
|
filter[key] = !!config[key];
|
|
}
|
|
return filter;
|
|
},
|
|
});
|
|
|
|
export default {
|
|
plugins,
|
|
endpointsConfig,
|
|
endpointsFilter,
|
|
defaultConfig,
|
|
endpointsQueryEnabled,
|
|
};
|