Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -539,6 +539,7 @@ def fix_visual_after_section(report_html: str, section_title: str, extra_instruc
|
|
| 539 |
It sends the current iframe 'srcdoc' (which should contain a mermaid diagram)
|
| 540 |
to the LLM with extra instructions and expects back a corrected mermaid code (starting with a mermaid diagram keyword).
|
| 541 |
It then rebuilds and reassigns the iframe's srcdoc with the improved code.
|
|
|
|
| 542 |
"""
|
| 543 |
soup = BeautifulSoup(report_html, "html.parser")
|
| 544 |
header = None
|
|
@@ -573,6 +574,7 @@ Return only the improved mermaid code (the content that should go inside the <di
|
|
| 573 |
- No introduction, conclusions or code fences -> Output the result directly - create only the content for the mermaid
|
| 574 |
- Do no put any comment of #color coding and classes inside the mermaid code generated, it's supposed to be only focused on the mermaid code required to render it
|
| 575 |
- Avoid the formatting commands (ex: %%...%% ) and do not use classDef, class or linkStyle for formatting
|
|
|
|
| 576 |
- Do not add items in the mermaid code between parenthesis ex: [xxx(yyy)] , rather use [xxx - yyy] / Do not put it in parenthesis, even after the hyphen - or for units.
|
| 577 |
- If you need to add a remark in the code, do it like this after an hyphen: "[abc - 95% Context Coverage]". Simply don't use parenthesis except for the below prescribed formatting, mermaid if very format sensitive
|
| 578 |
Example: do not write:
|
|
@@ -921,6 +923,7 @@ You are a technical editor.
|
|
| 921 |
Given the following HTML container (with its outer tags) extracted from a larger report and based on the user adjustment request,
|
| 922 |
produce a corrected version by making only the necessary changes. Preserve inline citations, formatting, and context.
|
| 923 |
The updated version will be put back in the exact same location and must have the same outer tags.
|
|
|
|
| 924 |
|
| 925 |
- Overall Report HTML:
|
| 926 |
{report_html}
|
|
|
|
| 539 |
It sends the current iframe 'srcdoc' (which should contain a mermaid diagram)
|
| 540 |
to the LLM with extra instructions and expects back a corrected mermaid code (starting with a mermaid diagram keyword).
|
| 541 |
It then rebuilds and reassigns the iframe's srcdoc with the improved code.
|
| 542 |
+
Make sure there's no parenthesis or line break in the mermaid code content.
|
| 543 |
"""
|
| 544 |
soup = BeautifulSoup(report_html, "html.parser")
|
| 545 |
header = None
|
|
|
|
| 574 |
- No introduction, conclusions or code fences -> Output the result directly - create only the content for the mermaid
|
| 575 |
- Do no put any comment of #color coding and classes inside the mermaid code generated, it's supposed to be only focused on the mermaid code required to render it
|
| 576 |
- Avoid the formatting commands (ex: %%...%% ) and do not use classDef, class or linkStyle for formatting
|
| 577 |
+
- Do not skip lines or add line breaks in the content of the mermaid code
|
| 578 |
- Do not add items in the mermaid code between parenthesis ex: [xxx(yyy)] , rather use [xxx - yyy] / Do not put it in parenthesis, even after the hyphen - or for units.
|
| 579 |
- If you need to add a remark in the code, do it like this after an hyphen: "[abc - 95% Context Coverage]". Simply don't use parenthesis except for the below prescribed formatting, mermaid if very format sensitive
|
| 580 |
Example: do not write:
|
|
|
|
| 923 |
Given the following HTML container (with its outer tags) extracted from a larger report and based on the user adjustment request,
|
| 924 |
produce a corrected version by making only the necessary changes. Preserve inline citations, formatting, and context.
|
| 925 |
The updated version will be put back in the exact same location and must have the same outer tags.
|
| 926 |
+
If the original container is a mermaid code, make sure the new version does not include parenthesis or line break in the content of the mermaid pseudo-code.
|
| 927 |
|
| 928 |
- Overall Report HTML:
|
| 929 |
{report_html}
|