mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-21 00:52:24 -05:00
[PR #18008] [CLOSED] feat: add dynamic enum support for UserValves/Valves with API-driven dropdowns #63492
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/18008
Author: @Simon-Stone
Created: 10/2/2025
Status: ❌ Closed
Base:
dev← Head:valves-dynamic-enum📝 Commits (1)
2451c2efeat: dynamic enums📊 Changes
1 file changed (+208 additions, -0 deletions)
View changed files
📝
src/lib/components/common/Valves.svelte(+208 -0)📄 Description
feat: Add dynamic enum support for UserValves/Valves with API-driven dropdowns
Description
This pull request introduces dynamic enum population for UserValves and Valves in Functions and Tools. Instead of hardcoding dropdown options, developers can now specify API endpoints that are queried at runtime with user authentication, allowing for user-specific, permission-based dropdown options.
This enhancement solves a critical limitation where dropdown options couldn't be personalized based on the authenticated user's context. For example, a UserValve for "preferred model" can now show only the models the specific user has access to, rather than all models in the system.
Key Benefits:
Added
json_schema_extra: Pydantic Field definitions now support adynamic_enumparameter that tells the frontend which API endpoint to queryValves.svelte:Changed
src/lib/components/common/Valves.svelte: Extended to detect and render dynamic enum fields with API-driven optionsDeprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Configuration Example:
Technical Implementation:
json_schema_extrafields to the top level of the JSON schema, makingdynamic_enumdirectly accessible on property specsUse Cases:
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.