[Feature Request]: <title> The model may generate a json string in markdown format
Is your feature request related to a problem? Please describe.
The model may generate a json string in markdown format
Describe the solution you'd like
Solution: Replace markdown syntax with re
import re
if re.match(r'```json\n.*\n```', output, re.DOTALL):
output = re.search(r'```json\n(.*)\n```', output, re.DOTALL).group(1)
return LLMOutput(output=output)
After use, the entire workflow can be completed, as shown in the figure
Additional context
No response
修改一下
try:
if re.match(r'```json\n.*\n```', output, re.DOTALL):
output = re.search(r'```json\n(.*)\n```', output, re.DOTALL).group(1)
except:
pass
Suggest submission, the prompt has been modified many times but still cannot be formatted correctly.
Suggest submission, the prompt has been modified many times but still cannot be formatted correctly.建议提交,提示已修改多次但仍无法正确格式化。
I also tried to modify the prompt words to make the output more json instead of markdown, but I found that I couldn't do it, so I modified the source code.
This issue has been marked stale due to inactivity after repo maintainer or community member responses that request more information or suggest a solution. It will be closed after five additional days.
We have resolved several issues related to text encoding and JSON parsing that are rolled up into version 0.2.2. Please try again with that version and re-open if this is still an issue.