mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-27 15:49:23 -05:00
fix: show follow-up suggestions when the task model adds text around its JSON (#32323)
This commit is contained in:
1 file changed
+1
-1
@@ -348,7 +348,7 @@ async def follow_up_generation_template(
|
||||
def parse_follow_ups(content: str, max_count: int = 5) -> list[str]:
|
||||
if not isinstance(content, str):
|
||||
return []
|
||||
content = re.sub(r'^```(?:json)?\s*|\s*```$', '', content.strip())
|
||||
content = content[content.find('{') : content.rfind('}') + 1]
|
||||
try:
|
||||
data = JSONCodec.loads(content)
|
||||
except (ValueError, TypeError):
|
||||
|
||||
Reference in new issue
Block a user