diff --git a/src/api/routes/sops.py b/src/api/routes/sops.py index 96c4fdf..78bd6df 100644 --- a/src/api/routes/sops.py +++ b/src/api/routes/sops.py @@ -351,17 +351,8 @@ def generate_executive_goals_from_doc(): if not vision_mission: return jsonify({"error": "Vision and Mission generation error ", "message": "Error in generating mssion and viso."}), 400 - # Check if both vision and mission are empty - if not vision_mission.get('vision') and not vision_mission.get('mission'): - # Cleanup: Delete all files in the upload directory if parsing fails - delete_all_files_in_directory(upload_folder) - return jsonify({"vision": [], "mission": [], "message": "The document does not contain mission and vision."}), 200 - - print(f"Vision and mission: {vision_mission}") - vission = vision_mission.get('vision') - mission = vision_mission.get('mission') - - return jsonify({"mission": mission, "vission": vission, "message": "vision and mission generated successfully"}), 200 + response = vision_mission.get("response") + return jsonify({"data": response, "message": "vision and mission generated successfully"}), 200 except Exception as e: # Cleanup: Delete all files in the upload directory if an error occurs diff --git a/src/models/sop_response_schemas.py b/src/models/sop_response_schemas.py index e9265a8..739a34f 100644 --- a/src/models/sop_response_schemas.py +++ b/src/models/sop_response_schemas.py @@ -36,8 +36,8 @@ class DeptMisiion(BaseModel): goals: List[str] class VisionMissionResponse2(BaseModel): - vision: List[str] - mission: List[str] + response: List[str] + class VisionMissionResponse(BaseModel): vision: List[str] diff --git a/src/prompts/sops.py b/src/prompts/sops.py index 18ecdb9..976e15b 100644 --- a/src/prompts/sops.py +++ b/src/prompts/sops.py @@ -153,6 +153,10 @@ def get_vision_mission_extraction_from_doc2(): 8. If vision and mission is found in the document , extract them as it is ,no changes NOTED: if the goal(mission) and vision cant not be found at all, make it empty please NOTE: MAKE SURE YOU EXTRACT EVERY INFORMATION FOUND FOR VISION AND GOALS FROM THE DOCUMENT.DO NOT OMIT ANY +**You must return the response in the exact HTML `
` format shown below, including the numbering, lettered sub-points, `
` tags for line breaks, and the double `
` between departments. Adhere to this format precisely.**
+
+**Example Output Format:**
+
Vision: To be the best in the world
Company Goals:
1. Sales
a. Brand Awareness: To be the best in the world
b. Revenue Growth: Increase annual sales by 20% through strategic partnerships and lead generation.
2. Marketing
a. Digital Presence: Enhance online visibility through SEO and social media campaigns.
b. Customer Engagement: Boost engagement via personalized content and email marketing.
3. Product Development
a. Innovation: Launch 3 new features based on user feedback by Q4.
b. Quality Assurance: Maintain product bug rate under 2% through improved testing pipelines.
4. Human Resources
a. Talent Acquisition: Recruit top talent and reduce time-to-hire to under 30 days.
b. Employee Retention: Increase employee retention by 15% through career development program.