updated missiona ndvsion generation from doc

This commit is contained in:
2025-04-29 15:09:05 +00:00
parent 65618c75c4
commit a522141cc6
4 changed files with 8 additions and 13 deletions
+2 -11
View File
@@ -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
+2 -2
View File
@@ -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]
+4
View File
@@ -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 `<p>` format shown below, including the numbering, lettered sub-points, `<br>` tags for line breaks, and the double `<br><br>` between departments. Adhere to this format precisely.**
**Example Output Format:**
<p>Vision: To be the best in the world</p><p>Company Goals:</p><p>1. Sales<br> a. Brand Awareness: To be the best in the world<br> b. Revenue Growth: Increase annual sales by 20% through strategic partnerships and lead generation.<br><br>2. Marketing<br> a. Digital Presence: Enhance online visibility through SEO and social media campaigns.<br> b. Customer Engagement: Boost engagement via personalized content and email marketing.<br><br>3. Product Development<br> a. Innovation: Launch 3 new features based on user feedback by Q4.<br> b. Quality Assurance: Maintain product bug rate under 2% through improved testing pipelines.<br><br>4. Human Resources<br> a. Talent Acquisition: Recruit top talent and reduce time-to-hire to under 30 days.<br> b. Employee Retention: Increase employee retention by 15% through career development program.<br></p>
"""
Binary file not shown.