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
+3 -6
View File
@@ -312,11 +312,9 @@ def generate_executive_goals_from_doc():
if 'document' not in request.files:
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:
departments = request.form.get('departments')
departments = request.form.get('departments','[]')
# Manually load roles from the string to JSON
departments = json.loads(departments)
@@ -457,10 +455,9 @@ def generate_vision_goals_quest():
sop_generator = SopGeneratorExecutive()
vision_mission = sop_generator.generate_vision_mission_from_questionnaire(questionnaire_data)
vission = vision_mission.get('vision')
mission = vision_mission.get('mission')
data = vision_mission.get('response')
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:
return make_response(jsonify({"error": "Processing error", "message": f"An error occurred while processing the request: {str(e)}"}), 500)
+4
View File
@@ -35,6 +35,10 @@ class DeptMisiion(BaseModel):
departments: str
goals: List[str]
class VisionMissionResponse3(BaseModel):
mission: List[str]
vision: List[str]
class VisionMissionResponse2(BaseModel):
response: 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
**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:**
<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: 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",
"content": f"Department to consider for the company goals generation{departments}"
"content": f"Department to consider for the company goals generation: {departments}"
},
{
"role": "user",
Binary file not shown.