enh: dynamic select options valve

This commit is contained in:
Timothy Jaeryang Baek
2026-01-22 03:55:07 +04:00
parent 00b3583dc2
commit 474427c67e
4 changed files with 177 additions and 4 deletions
+9 -2
View File
@@ -19,6 +19,7 @@ from open_webui.utils.plugin import (
load_function_module_by_id,
replace_imports,
get_function_module_from_cache,
resolve_valves_schema_options,
)
from open_webui.config import CACHE_DIR
from open_webui.constants import ERROR_MESSAGES
@@ -446,7 +447,10 @@ async def get_function_valves_spec_by_id(
if hasattr(function_module, "Valves"):
Valves = function_module.Valves
return Valves.schema()
schema = Valves.schema()
# Resolve dynamic options for select dropdowns
schema = resolve_valves_schema_options(Valves, schema, user)
return schema
return None
else:
raise HTTPException(
@@ -546,7 +550,10 @@ async def get_function_user_valves_spec_by_id(
if hasattr(function_module, "UserValves"):
UserValves = function_module.UserValves
return UserValves.schema()
schema = UserValves.schema()
# Resolve dynamic options for select dropdowns
schema = resolve_valves_schema_options(UserValves, schema, user)
return schema
return None
else:
raise HTTPException(