mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-14 04:08:46 +00:00
fix: show follow-up suggestions when the task model adds text around its JSON (#32323)
This commit is contained in:
parent
99a9f60b9f
commit
1c5f101d0b
1 changed files with 1 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue