Merge pull request #9688 from yfzhou0904/main

feat: if autocomplete-generation is turned off, frontend should not attempt autocomplete request
This commit is contained in:
Timothy Jaeryang Baek 2025-02-09 13:07:43 -08:00 committed by GitHub
commit a1b31f99ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 1 deletions

View File

@ -1019,6 +1019,7 @@ async def get_app_config(request: Request):
"enable_image_generation": app.state.config.ENABLE_IMAGE_GENERATION, "enable_image_generation": app.state.config.ENABLE_IMAGE_GENERATION,
"enable_community_sharing": app.state.config.ENABLE_COMMUNITY_SHARING, "enable_community_sharing": app.state.config.ENABLE_COMMUNITY_SHARING,
"enable_message_rating": app.state.config.ENABLE_MESSAGE_RATING, "enable_message_rating": app.state.config.ENABLE_MESSAGE_RATING,
"enable_autocomplete_generation": app.state.config.ENABLE_AUTOCOMPLETE_GENERATION,
"enable_admin_export": ENABLE_ADMIN_EXPORT, "enable_admin_export": ENABLE_ADMIN_EXPORT,
"enable_admin_chat_access": ENABLE_ADMIN_CHAT_ACCESS, "enable_admin_chat_access": ENABLE_ADMIN_CHAT_ACCESS,
} }

View File

@ -695,7 +695,7 @@
)} )}
placeholder={placeholder ? placeholder : $i18n.t('Send a Message')} placeholder={placeholder ? placeholder : $i18n.t('Send a Message')}
largeTextAsFile={$settings?.largeTextAsFile ?? false} largeTextAsFile={$settings?.largeTextAsFile ?? false}
autocomplete={true} autocomplete={$config?.features.enable_autocomplete_generation}
generateAutoCompletion={async (text) => { generateAutoCompletion={async (text) => {
if (selectedModelIds.length === 0 || !selectedModelIds.at(0)) { if (selectedModelIds.length === 0 || !selectedModelIds.at(0)) {
toast.error($i18n.t('Please select a model first.')); toast.error($i18n.t('Please select a model first.'));

View File

@ -206,6 +206,7 @@ type Config = {
enable_admin_export: boolean; enable_admin_export: boolean;
enable_admin_chat_access: boolean; enable_admin_chat_access: boolean;
enable_community_sharing: boolean; enable_community_sharing: boolean;
enable_autocomplete_generation: boolean;
}; };
oauth: { oauth: {
providers: { providers: {