Update functions.py
Browse files- functions.py +19 -3
functions.py
CHANGED
|
@@ -52,23 +52,39 @@ def get_report_sections(report_type):
|
|
| 52 |
("Executive Summary", "generate_executive_summary"),
|
| 53 |
("Research Objectives", "generate_research_objectives"),
|
| 54 |
("Research Methodology", "generate_methodology_section"),
|
| 55 |
-
("Research Timeline", "generate_research_timeline")
|
|
|
|
| 56 |
],
|
| 57 |
"Research Paper": [
|
| 58 |
("Introduction", "generate_proposal_introduction"),
|
| 59 |
("Literature Review", "generate_literature_review_outline"),
|
| 60 |
("Research Methodology", "generate_methodology_section"),
|
| 61 |
-
("Conclusion", "generate_contribution_statement")
|
|
|
|
| 62 |
],
|
| 63 |
"Thesis": [
|
| 64 |
("Abstract", "generate_proposal_introduction"),
|
| 65 |
("Research Objectives", "generate_research_objectives"),
|
| 66 |
("Methodology", "generate_methodology_section"),
|
| 67 |
-
("Limitations", "generate_limitations_section")
|
|
|
|
| 68 |
]
|
| 69 |
}
|
| 70 |
return report_sections.get(report_type, [])
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
# Define the actual generation functions, like:
|
| 73 |
def generate_executive_summary(data):
|
| 74 |
return f"Executive Summary for {data['research_topic']}"
|
|
|
|
| 52 |
("Executive Summary", "generate_executive_summary"),
|
| 53 |
("Research Objectives", "generate_research_objectives"),
|
| 54 |
("Research Methodology", "generate_methodology_section"),
|
| 55 |
+
("Research Timeline", "generate_research_timeline"),
|
| 56 |
+
("All Sections", "generate_all_sections") # New entry for all sections
|
| 57 |
],
|
| 58 |
"Research Paper": [
|
| 59 |
("Introduction", "generate_proposal_introduction"),
|
| 60 |
("Literature Review", "generate_literature_review_outline"),
|
| 61 |
("Research Methodology", "generate_methodology_section"),
|
| 62 |
+
("Conclusion", "generate_contribution_statement"),
|
| 63 |
+
("All Sections", "generate_all_sections") # New entry for all sections
|
| 64 |
],
|
| 65 |
"Thesis": [
|
| 66 |
("Abstract", "generate_proposal_introduction"),
|
| 67 |
("Research Objectives", "generate_research_objectives"),
|
| 68 |
("Methodology", "generate_methodology_section"),
|
| 69 |
+
("Limitations", "generate_limitations_section"),
|
| 70 |
+
("All Sections", "generate_all_sections") # New entry for all sections
|
| 71 |
]
|
| 72 |
}
|
| 73 |
return report_sections.get(report_type, [])
|
| 74 |
|
| 75 |
+
def generate_all_sections(data):
|
| 76 |
+
"""
|
| 77 |
+
Generate all sections for the specified report type.
|
| 78 |
+
"""
|
| 79 |
+
sections_content = {}
|
| 80 |
+
report_sections = get_report_sections(data.get("report_type"))
|
| 81 |
+
|
| 82 |
+
for section_name, function_name in report_sections:
|
| 83 |
+
if function_name != "generate_all_sections": # Skip this function itself
|
| 84 |
+
sections_content[section_name] = call_dynamic_function(function_name, data)
|
| 85 |
+
|
| 86 |
+
return sections_content
|
| 87 |
+
|
| 88 |
# Define the actual generation functions, like:
|
| 89 |
def generate_executive_summary(data):
|
| 90 |
return f"Executive Summary for {data['research_topic']}"
|