Skip to content

Commit 8a6af40

Browse files
authored
fix: correct conflicting output format instruction in follow-up generation prompt (open-webui#22212)
The Guidelines section instructed LLMs to return "a JSON array of strings" while the Output section showed a JSON object with a "follow_ups" key. This mismatch caused some models to return a top-level array, which the frontend parser cannot handle (it looks for `{ }` delimiters and the `follow_ups` key). Updated the guideline to consistently request a JSON object matching the expected format. Fixes open-webui#22187
1 parent 9cf6108 commit 8a6af40

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/open_webui/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,7 @@ class BannerModel(BaseModel):
19601960
- Only suggest follow-ups that make sense given the chat content and do not repeat what was already covered.
19611961
- If the conversation is very short or not specific, suggest more general (but relevant) follow-ups the user might ask.
19621962
- Use the conversation's primary language; default to English if multilingual.
1963-
- Response must be a JSON array of strings, no extra text or formatting.
1963+
- Response must be a JSON object with a "follow_ups" key containing an array of strings, no extra text or formatting.
19641964
### Output:
19651965
JSON format: { "follow_ups": ["Question 1?", "Question 2?", "Question 3?"] }
19661966
### Chat History:

0 commit comments

Comments
 (0)