mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
feat(config): add location feature flag and geocoder config
Adds a `location` section to librechat.yaml config with enabled/geocoder fields, wires loadLocationConfig into AppService, and surfaces the resolved flag in the startup-config endpoint so the UI can gate location controls.
This commit is contained in:
parent
baa369a448
commit
fdca6184ba
6 changed files with 74 additions and 0 deletions
|
|
@ -181,6 +181,18 @@ function buildWebSearchConfig(appConfig) {
|
|||
};
|
||||
}
|
||||
|
||||
function buildLocationStartupConfig(appConfig) {
|
||||
const loc = appConfig?.location;
|
||||
if (!loc || loc.enabled === false) {
|
||||
return undefined;
|
||||
}
|
||||
const out = { enabled: true };
|
||||
if (loc.geocoder?.endpoint) {
|
||||
out.geocoder = { endpoint: loc.geocoder.endpoint };
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function buildCloudFrontStartupConfig() {
|
||||
const config = getCloudFrontConfig();
|
||||
if (
|
||||
|
|
@ -284,6 +296,11 @@ router.get('/', async function (req, res) {
|
|||
payload.webSearch = webSearch;
|
||||
}
|
||||
|
||||
const location = buildLocationStartupConfig(appConfig);
|
||||
if (location) {
|
||||
payload.location = location;
|
||||
}
|
||||
|
||||
const buildInfo = buildBuildInfoPayload(appConfig?.interfaceConfig);
|
||||
if (buildInfo) {
|
||||
payload.buildInfo = buildInfo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue