Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -729,8 +729,12 @@ def iterative_deep_research_gen(initial_query: str, reportstyle: str, breadth: i
|
|
| 729 |
|
| 730 |
# Now use cleaned_content to generate summary (instead of raw_content directly)
|
| 731 |
analysis = analyze_with_gpt4o(initial_query, cleaned_content, breadth)
|
| 732 |
-
analysis_summary = analysis.get("summary", "")
|
| 733 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 734 |
process_log += (f"Summary: {analysis.get('summary')}, Follow-ups: {analysis.get('followups')}\n")
|
| 735 |
if not analysis_summary:
|
| 736 |
analysis_summary = (raw_content[:200] + "..." if len(raw_content) > 200 else raw_content)
|
|
|
|
| 729 |
|
| 730 |
# Now use cleaned_content to generate summary (instead of raw_content directly)
|
| 731 |
analysis = analyze_with_gpt4o(initial_query, cleaned_content, breadth)
|
| 732 |
+
analysis_summary = analysis.get("summary", "")
|
| 733 |
+
if isinstance(analysis_summary, (dict, list)):
|
| 734 |
+
# Convert the JSON structure to a string
|
| 735 |
+
analysis_summary = json.dumps(analysis_summary)
|
| 736 |
+
analysis_summary = analysis_summary.strip()
|
| 737 |
+
|
| 738 |
process_log += (f"Summary: {analysis.get('summary')}, Follow-ups: {analysis.get('followups')}\n")
|
| 739 |
if not analysis_summary:
|
| 740 |
analysis_summary = (raw_content[:200] + "..." if len(raw_content) > 200 else raw_content)
|