Update functions.py
Browse files- functions.py +31 -0
functions.py
CHANGED
|
@@ -15,6 +15,37 @@ highlights_options = {
|
|
| 15 |
"highlights_per_url": 1, # Get the best highlight for each URL
|
| 16 |
}
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
def call_llm(prompt):
|
| 19 |
"""
|
| 20 |
Call the Exa and Groq APIs to generate content using the provided prompt.
|
|
|
|
| 15 |
"highlights_per_url": 1, # Get the best highlight for each URL
|
| 16 |
}
|
| 17 |
|
| 18 |
+
def get_report_fields(report_type):
|
| 19 |
+
"""
|
| 20 |
+
Return a list of fields (field_key, field_label) based on the report type.
|
| 21 |
+
"""
|
| 22 |
+
common_fields = [
|
| 23 |
+
("research_topic", "Research Topic"),
|
| 24 |
+
("research_question", "Research Question"),
|
| 25 |
+
("objectives", "Research Objectives (SMART)"),
|
| 26 |
+
("methodology", "Research Methodology"),
|
| 27 |
+
("timeline", "Research Timeline"),
|
| 28 |
+
("email", "Contact Email"),
|
| 29 |
+
]
|
| 30 |
+
|
| 31 |
+
if report_type == "PhD Proposal":
|
| 32 |
+
return common_fields + [
|
| 33 |
+
("justification", "Justification for Methodology"),
|
| 34 |
+
("literature_gap", "Literature Gap")
|
| 35 |
+
]
|
| 36 |
+
elif report_type == "Research Paper":
|
| 37 |
+
return common_fields + [
|
| 38 |
+
("introduction", "Introduction"),
|
| 39 |
+
("conclusion", "Conclusion")
|
| 40 |
+
]
|
| 41 |
+
elif report_type == "Thesis":
|
| 42 |
+
return common_fields + [
|
| 43 |
+
("abstract", "Abstract"),
|
| 44 |
+
("limitations", "Limitations")
|
| 45 |
+
]
|
| 46 |
+
|
| 47 |
+
return common_fields
|
| 48 |
+
|
| 49 |
def call_llm(prompt):
|
| 50 |
"""
|
| 51 |
Call the Exa and Groq APIs to generate content using the provided prompt.
|