[PR #8748] [CLOSED] refactor: making DEFAULT_PROMPT_SUGGESTIONS env var #22283

Closed
opened 2026-04-20 04:02:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/8748
Author: @tim-roethig
Created: 1/22/2025
Status: Closed

Base: devHead: make-DEFAULT_PROMPT_SUGGESTIONS-env-var


📝 Commits (9)

📊 Changes

1 file changed (+50 additions, -75 deletions)

View changed files

📝 backend/open_webui/config.py (+50 -75)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for validating the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • [Concisely describe the changes made in this pull request, including any relevant motivation and impact (e.g., fixing a bug, adding a feature, or improving performance)]

This PR adds the possibility to configure DEFAULT_PROMPT_SUGGESTIONS via an env var of the same name analog to WEBUI_BANNERS. Previously this was only possible via the settings menu.

Added

  • env var DEFAULT_PROMPT_SUGGESTIONS
  • pydantic model to validate DEFAULT_PROMPT_SUGGESTIONS

Changed

  • DEFAULT_PROMPT_SUGGESTIONS PersistentConfig

Deprecated

  • None

Removed

  • None

Fixed

  • None

Security

  • None

Breaking Changes

  • None

Additional Information

  • docs entry:

DEFAULT_PROMPT_SUGGESTIONS

  • Type: list of dict
  • Description: List of prompt suggestions to show to users. Format of prompt suggestions are:
[
    {
        "title": ["Help me study", "vocabulary for a college entrance exam"],
        "content": "Help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option.",
    },
    {
        "title": ["Give me ideas", "for what to do with my kids' art"],
        "content": "What are 5 creative things I could do with my kids' art? I don't want to throw them away, but it's also so much clutter.",
    },
]
  • Persistence: This environment variable is a PersistentConfig variable.

:::info

When setting this environment variable in a .env file, make sure to escape the quotes by wrapping the entire value in double quotes and using escaped quotes (\") for the inner quotes. Example:

DEFAULT_PROMPT_SUGGESTIONS="[{\"title\": [\"Help me study\", \"vocabulary for a college entrance exam\"], \"content\": \"Help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option.\"}, {\"title\": [\"Give me ideas\", \"for what to do with my kids' art\"], \"content\": \"What are 5 creative things I could do with my kids' art? I don't want to throw them away, but it's also so much clutter.\"}]"

### Screenshots or Videos

- None

---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/8748 **Author:** [@tim-roethig](https://github.com/tim-roethig) **Created:** 1/22/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `make-DEFAULT_PROMPT_SUGGESTIONS-env-var` --- ### 📝 Commits (9) - [`2faa819`](https://github.com/open-webui/open-webui/commit/2faa819257f969a6121ddffcfb9d8ef63afa21e1) eagr - [`9a99456`](https://github.com/open-webui/open-webui/commit/9a9945687649d3b11f2e8e7c4b4d7306e4d3471e) Merge branch 'dev' of https://github.com/tim-roethig-db/open-webui into dev - [`56c1340`](https://github.com/open-webui/open-webui/commit/56c1340a1a1ec20a4dca97861fd2a1d560444a74) Merge branch 'open-webui:dev' into dev - [`459bf19`](https://github.com/open-webui/open-webui/commit/459bf1952bf71ebcecee26bf652a762ad675a665) Merge branch 'open-webui:dev' into dev - [`ad56216`](https://github.com/open-webui/open-webui/commit/ad56216179e016c02129d142f81a97efae8fa711) Merge branch 'open-webui:dev' into dev - [`4fe0b25`](https://github.com/open-webui/open-webui/commit/4fe0b25dc93456a3dfc7c42ebbc4bc18860adf71) Merge branch 'open-webui:dev' into dev - [`773fefc`](https://github.com/open-webui/open-webui/commit/773fefc379733f2f059c1184030580a9124c0834) making DEFAULT_PROMPT_SUGGESTIONS env var - [`b54f7ea`](https://github.com/open-webui/open-webui/commit/b54f7ea758e0f852aa84413f7efca78a11e181fd) refactor: update PromptSuggestionModel to use Tuple for title and improve error logging - [`587e546`](https://github.com/open-webui/open-webui/commit/587e546b3ca62d166afd68a70b00391b43bd555b) revert gitignore ### 📊 Changes **1 file changed** (+50 additions, -75 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+50 -75) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [ ] **Testing:** Have you written and run sufficient tests for validating the changes? - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Description - [Concisely describe the changes made in this pull request, including any relevant motivation and impact (e.g., fixing a bug, adding a feature, or improving performance)] This PR adds the possibility to configure DEFAULT_PROMPT_SUGGESTIONS via an env var of the same name analog to WEBUI_BANNERS. Previously this was only possible via the settings menu. ### Added - env var DEFAULT_PROMPT_SUGGESTIONS - pydantic model to validate DEFAULT_PROMPT_SUGGESTIONS ### Changed - DEFAULT_PROMPT_SUGGESTIONS PersistentConfig ### Deprecated - None ### Removed - None ### Fixed - None ### Security - None ### Breaking Changes - None --- ### Additional Information - docs entry: #### `DEFAULT_PROMPT_SUGGESTIONS` - Type: `list` of `dict` - Description: List of prompt suggestions to show to users. Format of prompt suggestions are: ```json [ { "title": ["Help me study", "vocabulary for a college entrance exam"], "content": "Help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option.", }, { "title": ["Give me ideas", "for what to do with my kids' art"], "content": "What are 5 creative things I could do with my kids' art? I don't want to throw them away, but it's also so much clutter.", }, ] ``` - Persistence: This environment variable is a `PersistentConfig` variable. :::info When setting this environment variable in a `.env` file, make sure to escape the quotes by wrapping the entire value in double quotes and using escaped quotes (`\"`) for the inner quotes. Example: ``` DEFAULT_PROMPT_SUGGESTIONS="[{\"title\": [\"Help me study\", \"vocabulary for a college entrance exam\"], \"content\": \"Help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option.\"}, {\"title\": [\"Give me ideas\", \"for what to do with my kids' art\"], \"content\": \"What are 5 creative things I could do with my kids' art? I don't want to throw them away, but it's also so much clutter.\"}]" ### Screenshots or Videos - None --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 04:02:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#22283