Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -243,35 +243,37 @@ Only output valid JSON."""
|
|
| 243 |
continue
|
| 244 |
|
| 245 |
original_container_html = str(candidate)
|
| 246 |
-
logging.info("fine_tune_report: Found container for unique string adjustment
|
| 247 |
|
| 248 |
# Step 3: Call the LLM to adjust this container.
|
| 249 |
prompt_adjust = (f"""
|
| 250 |
You are a technical editor.
|
| 251 |
Given the following HTML container (with its outer tags) extracted from a larger report and based on the user adjustment request,
|
| 252 |
produce a corrected version by making only the necessary changes. Preserve inline citations, formatting, and context.
|
|
|
|
| 253 |
|
| 254 |
-
|
| 255 |
-
-
|
| 256 |
-
- "summary" (a brief explanation of the changes)
|
| 257 |
-
|
| 258 |
-
Overall Report HTML:
|
| 259 |
{report_html}
|
|
|
|
|
|
|
| 260 |
|
| 261 |
-
|
|
|
|
| 262 |
{original_container_html}
|
| 263 |
|
| 264 |
-
User Adjustment Request:
|
| 265 |
{adjustment_request}
|
| 266 |
|
| 267 |
Additional Guidance:
|
| 268 |
- Target Style: {target_style}
|
| 269 |
-
-
|
| 270 |
-
{knowledge_crumbs}
|
| 271 |
-
|
| 272 |
-
Complementary Guidance:
|
| 273 |
{complementary_guidance}
|
| 274 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 275 |
Only output valid JSON."""
|
| 276 |
)
|
| 277 |
|
|
|
|
| 243 |
continue
|
| 244 |
|
| 245 |
original_container_html = str(candidate)
|
| 246 |
+
logging.info(f"fine_tune_report: Found container for unique string adjustment:\n\n{original_container_html}\n\n")
|
| 247 |
|
| 248 |
# Step 3: Call the LLM to adjust this container.
|
| 249 |
prompt_adjust = (f"""
|
| 250 |
You are a technical editor.
|
| 251 |
Given the following HTML container (with its outer tags) extracted from a larger report and based on the user adjustment request,
|
| 252 |
produce a corrected version by making only the necessary changes. Preserve inline citations, formatting, and context.
|
| 253 |
+
The updated version will put back precisely in the same location.
|
| 254 |
|
| 255 |
+
// Context
|
| 256 |
+
- Overall Report HTML:
|
|
|
|
|
|
|
|
|
|
| 257 |
{report_html}
|
| 258 |
+
- Knowledge Crumbs you can use if relevant - collected from various search results:
|
| 259 |
+
{knowledge_crumbs}
|
| 260 |
|
| 261 |
+
// Request
|
| 262 |
+
- Original Container to Adjust:
|
| 263 |
{original_container_html}
|
| 264 |
|
| 265 |
+
- User Adjustment Request:
|
| 266 |
{adjustment_request}
|
| 267 |
|
| 268 |
Additional Guidance:
|
| 269 |
- Target Style: {target_style}
|
| 270 |
+
- Complementary Guidance:
|
|
|
|
|
|
|
|
|
|
| 271 |
{complementary_guidance}
|
| 272 |
|
| 273 |
+
Ensure the updated content remains consistent with the overall report style. Output a JSON object with exactly two keys:
|
| 274 |
+
- "improved" (the corrected container's full HTML) and
|
| 275 |
+
- "summary" (a brief explanation of the changes)
|
| 276 |
+
|
| 277 |
Only output valid JSON."""
|
| 278 |
)
|
| 279 |
|