mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-27 17:56:26 -04:00
fix: stop asking for chat variables a model's system prompt no longer declares (#30173)
This commit is contained in:
@@ -62,6 +62,8 @@ def add_chat_variables_schema(model_dict: dict) -> dict:
|
||||
schema = get_chat_variables_schema(system)
|
||||
if schema:
|
||||
model_dict.setdefault('meta', {})['chat_variables_schema'] = schema
|
||||
elif isinstance(model_dict.get('meta'), dict):
|
||||
model_dict['meta'].pop('chat_variables_schema', None)
|
||||
return model_dict
|
||||
|
||||
|
||||
|
||||
@@ -187,6 +187,8 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
||||
schema = get_chat_variables_schema(custom_model.params.model_dump().get('system'))
|
||||
if schema:
|
||||
model['info'].setdefault('meta', {})['chat_variables_schema'] = schema
|
||||
elif isinstance(model['info'].get('meta'), dict):
|
||||
model['info']['meta'].pop('chat_variables_schema', None)
|
||||
|
||||
action_ids = []
|
||||
filter_ids = []
|
||||
@@ -239,6 +241,8 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
||||
schema = get_chat_variables_schema(custom_model.params.model_dump().get('system'))
|
||||
if schema:
|
||||
info.setdefault('meta', {})['chat_variables_schema'] = schema
|
||||
elif isinstance(info.get('meta'), dict):
|
||||
info['meta'].pop('chat_variables_schema', None)
|
||||
if 'params' in info:
|
||||
# Remove params to avoid exposing sensitive info
|
||||
del info['params']
|
||||
|
||||
Reference in New Issue
Block a user