open-webui / pipelines

Pipelines: Versatile, UI-Agnostic OpenAI-Compatible Plugin Framework
MIT License
1.04k stars 324 forks source link

Feature Request: Pipeline Valves with discrete lists of options #218

Closed PlebeiusGaragicus closed 3 weeks ago

PlebeiusGaragicus commented 3 months ago

While working on LangGraph agents I noticed a new and useful feature in LangGraph Studio where configurable options can be given as a discrete list of possibilities.

Link to code example

# Define the config
class GraphConfig(TypedDict):
    model_name: Literal["anthropic", "openai"]

This code now tells LangGraph Studio to display these as a nice list in the UI.

I'm requesting that we also have the Pipelines Valve UI display a list of options as defined in the pipeline code itself. After looking through the examples I haven't noticed if this has been implemented yet and it would be very helpful.

milafrerichs commented 3 weeks ago

this is already possible:

class Pipeline:
    class Valves(BaseModel):
        MODEL_NAME: Literal["anthropic", "openai"]