refac
This commit is contained in:
1 parent
35f8bf97e3
commit
b5c43968db
32 files changed
+2251
-120
No files matched your search
@@ -22,6 +22,7 @@ from open_webui.config import (
|
||||
CACHE_DIR,
|
||||
)
|
||||
from open_webui.constants import ERROR_MESSAGES
|
||||
from open_webui.events import EVENTS, publish_event
|
||||
from open_webui.env import (
|
||||
AIOHTTP_CLIENT_SESSION_SSL,
|
||||
AIOHTTP_CLIENT_TIMEOUT,
|
||||
@@ -310,6 +311,18 @@ async def update_config(request: Request, form_data: OpenAIConfigForm, user=Depe
|
||||
'openai.api_configs': api_configs,
|
||||
}
|
||||
)
|
||||
await publish_event(
|
||||
request,
|
||||
EVENTS.MODEL_PROVIDER_CONFIG_UPDATED,
|
||||
actor=user,
|
||||
subject_id='openai',
|
||||
subject_type='model.provider_config',
|
||||
data={
|
||||
'provider': 'openai',
|
||||
'enabled': form_data.ENABLE_OPENAI_API,
|
||||
'base_url_count': len(form_data.OPENAI_API_BASE_URLS),
|
||||
},
|
||||
)
|
||||
|
||||
return {
|
||||
'ENABLE_OPENAI_API': form_data.ENABLE_OPENAI_API,
|
||||
|
||||
Reference in new issue
Block a user