updated visiona and mission responses

This commit is contained in:
2025-05-02 09:57:41 +00:00
parent a522141cc6
commit 4c612fd0e6
5 changed files with 13 additions and 9 deletions
+4 -7
View File
@@ -312,11 +312,9 @@ def generate_executive_goals_from_doc():
if 'document' not in request.files: if 'document' not in request.files:
return jsonify({"error": "No file part", "message": "Please upload a file with the key 'document'."}), 400 return jsonify({"error": "No file part", "message": "Please upload a file with the key 'document'."}), 400
if 'departments' not in request.form:
return jsonify({"error": "department missing", "message": "Please provide departments'."}), 400
try: try:
departments = request.form.get('departments') departments = request.form.get('departments','[]')
# Manually load roles from the string to JSON # Manually load roles from the string to JSON
departments = json.loads(departments) departments = json.loads(departments)
@@ -457,10 +455,9 @@ def generate_vision_goals_quest():
sop_generator = SopGeneratorExecutive() sop_generator = SopGeneratorExecutive()
vision_mission = sop_generator.generate_vision_mission_from_questionnaire(questionnaire_data) vision_mission = sop_generator.generate_vision_mission_from_questionnaire(questionnaire_data)
vission = vision_mission.get('vision') data = vision_mission.get('response')
mission = vision_mission.get('mission')
return jsonify({"mission": mission, "vission": vission, "message": "vision and mission generated successfully"}), 200 return jsonify({"data": data, "message": "vision and mission generated successfully"}), 200
except Exception as e: except Exception as e:
return make_response(jsonify({"error": "Processing error", "message": f"An error occurred while processing the request: {str(e)}"}), 500) return make_response(jsonify({"error": "Processing error", "message": f"An error occurred while processing the request: {str(e)}"}), 500)
+5 -1
View File
@@ -35,9 +35,13 @@ class DeptMisiion(BaseModel):
departments: str departments: str
goals: List[str] goals: List[str]
class VisionMissionResponse3(BaseModel):
mission: List[str]
vision: List[str]
class VisionMissionResponse2(BaseModel): class VisionMissionResponse2(BaseModel):
response: List[str] response: List[str]
class VisionMissionResponse(BaseModel): class VisionMissionResponse(BaseModel):
vision: List[str] vision: List[str]
+3
View File
@@ -155,6 +155,7 @@ def get_vision_mission_extraction_from_doc2():
NOTE: MAKE SURE YOU EXTRACT EVERY INFORMATION FOUND FOR VISION AND GOALS FROM THE DOCUMENT.DO NOT OMIT ANY 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.** **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.**
NOTE: IF NO departments are provided, consider all departments found in the documents, do not omit any
**Example Output Format:** **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> <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>
""" """
@@ -195,6 +196,8 @@ def get_vision_mission_extraction_from_questionnaire_executive():
NOTE: If the goal and mission of a can not be gotten from the questionaire response, make it empty. NOTE: If the goal and mission of a can not be gotten from the questionaire response, make it empty.
NOTE: Ensure you extract every piece of information found for the vision and goals from the questionnaire. DO NOT OMIT ANYTHING. NOTE: Ensure you extract every piece of information found for the vision and goals from the questionnaire. DO NOT OMIT ANYTHING.
**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>
""" """
+1 -1
View File
@@ -117,7 +117,7 @@ class DocumentParser:
}, },
{ {
"role": "user", "role": "user",
"content": f"Department to consider for the company goals generation{departments}" "content": f"Department to consider for the company goals generation: {departments}"
}, },
{ {
"role": "user", "role": "user",
Binary file not shown.