mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 07:42:39 +02:00
feat(removed): sub_section_writer
- Its bad and not needed.
This commit is contained in:
parent
5ac6ebf199
commit
81ddc81026
57 changed files with 2213 additions and 4023 deletions
|
|
@ -2,105 +2,12 @@ import datetime
|
|||
|
||||
|
||||
def _build_language_instruction(language: str | None = None):
|
||||
"""Build language instruction for prompts."""
|
||||
if language:
|
||||
return f"\n\nIMPORTANT: Please respond in {language} language. All your responses, explanations, and analysis should be written in {language}."
|
||||
return ""
|
||||
|
||||
|
||||
def get_answer_outline_system_prompt(language: str | None = None) -> str:
|
||||
language_instruction = _build_language_instruction(language)
|
||||
|
||||
return f"""
|
||||
Today's date: {datetime.datetime.now().strftime("%Y-%m-%d")}
|
||||
{language_instruction}
|
||||
<answer_outline_system>
|
||||
You are an expert research assistant specializing in structuring information. Your task is to create a detailed and logical research outline based on the user's query. This outline will serve as the blueprint for generating a comprehensive research report.
|
||||
|
||||
<input>
|
||||
- user_query (string): The main question or topic the user wants researched. This guides the entire outline creation process.
|
||||
- num_sections (integer): The target number of distinct sections the final research report should have. This helps control the granularity and structure of the outline.
|
||||
</input>
|
||||
|
||||
<output_format>
|
||||
A JSON object with the following structure:
|
||||
{{
|
||||
"answer_outline": [
|
||||
{{
|
||||
"section_id": 0,
|
||||
"section_title": "Section Title",
|
||||
"questions": [
|
||||
"Question 1 to research for this section",
|
||||
"Question 2 to research for this section"
|
||||
]
|
||||
}}
|
||||
]
|
||||
}}
|
||||
</output_format>
|
||||
|
||||
<instructions>
|
||||
1. **Deconstruct the `user_query`:** Identify the key concepts, entities, and the core information requested by the user.
|
||||
2. **Determine Section Themes:** Based on the analysis and the requested `num_sections`, divide the topic into distinct, logical themes or sub-topics. Each theme will become a section. Ensure these themes collectively address the `user_query` comprehensively.
|
||||
3. **Develop Sections:** For *each* of the `num_sections`:
|
||||
* **Assign `section_id`:** Start with 0 and increment sequentially for each section.
|
||||
* **Craft `section_title`:** Write a concise, descriptive title that clearly defines the scope and focus of the section's theme.
|
||||
* **Formulate Research `questions`:** Generate 2 to 5 specific, targeted research questions for this section. These questions must:
|
||||
* Directly relate to the `section_title` and explore its key aspects.
|
||||
* Be answerable through focused research (e.g., searching documents, databases, or knowledge bases).
|
||||
* Be distinct from each other and from questions in other sections. Avoid redundancy.
|
||||
* Collectively guide the gathering of information needed to fully address the section's theme.
|
||||
4. **Ensure Logical Flow:** Arrange the sections in a coherent and intuitive sequence. Consider structures like:
|
||||
* General background -> Specific details -> Analysis/Comparison -> Applications/Implications
|
||||
* Problem definition -> Proposed solutions -> Evaluation -> Conclusion
|
||||
* Chronological progression
|
||||
5. **Verify Completeness and Cohesion:** Review the entire outline (`section_titles` and `questions`) to confirm that:
|
||||
* All sections together provide a complete and well-structured answer to the original `user_query`.
|
||||
* There are no significant overlaps or gaps in coverage between sections.
|
||||
6. **Adhere Strictly to Output Format:** Ensure the final output is a valid JSON object matching the specified structure exactly, including correct field names (`answer_outline`, `section_id`, `section_title`, `questions`) and data types.
|
||||
</instructions>
|
||||
|
||||
<examples>
|
||||
User Query: "What are the health benefits of meditation?"
|
||||
Number of Sections: 3
|
||||
|
||||
{{
|
||||
"answer_outline": [
|
||||
{{
|
||||
"section_id": 0,
|
||||
"section_title": "Physical Health Benefits of Meditation",
|
||||
"questions": [
|
||||
"What physiological changes occur in the body during meditation?",
|
||||
"How does regular meditation affect blood pressure and heart health?",
|
||||
"What impact does meditation have on inflammation and immune function?",
|
||||
"Can meditation help with pain management, and if so, how?"
|
||||
]
|
||||
}},
|
||||
{{
|
||||
"section_id": 1,
|
||||
"section_title": "Mental Health Benefits of Meditation",
|
||||
"questions": [
|
||||
"How does meditation affect stress and anxiety levels?",
|
||||
"What changes in brain structure or function have been observed in meditation practitioners?",
|
||||
"Can meditation help with depression and mood disorders?",
|
||||
"What is the relationship between meditation and cognitive function?"
|
||||
]
|
||||
}},
|
||||
{{
|
||||
"section_id": 2,
|
||||
"section_title": "Best Meditation Practices for Maximum Benefits",
|
||||
"questions": [
|
||||
"What are the most effective meditation techniques for beginners?",
|
||||
"How long and how frequently should one meditate to see benefits?",
|
||||
"Are there specific meditation approaches best suited for particular health goals?",
|
||||
"What common obstacles prevent people from experiencing meditation benefits?"
|
||||
]
|
||||
}}
|
||||
]
|
||||
}}
|
||||
</examples>
|
||||
</answer_outline_system>
|
||||
"""
|
||||
|
||||
|
||||
def get_further_questions_system_prompt():
|
||||
return f"""
|
||||
Today's date: {datetime.datetime.now().strftime("%Y-%m-%d")}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue