mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 00:06:04 +00:00
feat: add disable_models_service configuration to manage model service availability and update related components
This commit is contained in:
@@ -22,6 +22,9 @@ class SystemRouterGroup(group.RouterGroup):
|
||||
'allow_modify_login_info': self.ap.instance_config.data.get('system', {}).get(
|
||||
'allow_modify_login_info', True
|
||||
),
|
||||
'disable_models_service': self.ap.instance_config.data.get('space', {}).get(
|
||||
'disable_models_service', False
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -45,6 +45,12 @@ class ModelManager:
|
||||
|
||||
await self.load_models_from_db()
|
||||
|
||||
# Check if space models service is disabled
|
||||
space_config = self.ap.instance_config.data.get('space', {})
|
||||
if space_config.get('disable_models_service', False):
|
||||
self.ap.logger.info('LangBot Space Models service is disabled, skipping sync.')
|
||||
return
|
||||
|
||||
try:
|
||||
await self.sync_new_models_from_space()
|
||||
except Exception as e:
|
||||
|
||||
@@ -78,3 +78,4 @@ space:
|
||||
models_gateway_api_url: 'https://api.langbot.cloud'
|
||||
# OAuth authorization page URL (user will be redirected here)
|
||||
oauth_authorize_url: 'https://space.langbot.app/auth/authorize'
|
||||
disable_models_service: false
|
||||
|
||||
Reference in New Issue
Block a user