updated mission and vsion responses

This commit is contained in:
2025-05-13 23:22:07 +00:00
parent d005200145
commit ae25b7cf0c
6 changed files with 87 additions and 16 deletions
+2 -4
View File
@@ -409,7 +409,7 @@ def generate_executive_goals_from_doc():
if not vision_mission: if not vision_mission:
return jsonify({"error": "Vision and Mission generation error ", "message": "Error in generating mssion and viso."}), 400 return jsonify({"error": "Vision and Mission generation error ", "message": "Error in generating mssion and viso."}), 400
response = vision_mission.get("response") response = json.loads(vision_mission.get("response"))
return jsonify({"data": response, "message": "vision and mission generated successfully"}), 200 return jsonify({"data": response, "message": "vision and mission generated successfully"}), 200
except Exception as e: except Exception as e:
@@ -420,8 +420,6 @@ def generate_executive_goals_from_doc():
return jsonify({"error": "File type not allowed", "message": "The uploaded file type is not allowed. Please upload a PDF, DOC, or DOCX file."}), 400 return jsonify({"error": "File type not allowed", "message": "The uploaded file type is not allowed. Please upload a PDF, DOC, or DOCX file."}), 400
@sops_bp.route('/executive/generate_sop_managers_doc', methods=['POST']) @sops_bp.route('/executive/generate_sop_managers_doc', methods=['POST'])
@auth_check @auth_check
def generate_sop_managers_doc(): def generate_sop_managers_doc():
@@ -515,7 +513,7 @@ 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)
data = vision_mission.get('response') data = json.loads(vision_mission.get('response'))
return jsonify({"data": data, "message": "vision and mission generated successfully"}), 200 return jsonify({"data": data, "message": "vision and mission generated successfully"}), 200
+4
View File
@@ -43,6 +43,10 @@ class VisionMissionResponse3(BaseModel):
class VisionMissionResponse2(BaseModel): class VisionMissionResponse2(BaseModel):
response: List[str] response: List[str]
class VisionMissionResponseV3(BaseModel):
response: str
class VisionMissionResponse(BaseModel): class VisionMissionResponse(BaseModel):
vision: List[str] vision: List[str]
+74 -6
View File
@@ -172,15 +172,50 @@ 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 **Instructions:**
**Example Output Format:** **Example Output Format:** Two texts (one for vision and for goal) - If **no departments are explicitly mentioned**, assume all content applies to all departments mentioned in the document.
- Group goals by department when possible.
- Each goal should have a **title** and **a short description**.
- Format your output with:
- An **HTML section** for rendering on the frontend.
- A **structured JSON section** with department-wise goal breakdown.
<p>Vision: To create a future where our organization is recognized for its contributions and effectiveness in achieving its goals.</p>" **Example Output Format:**
“<p>Company Goals:</p><p>1. Account Management: Manage accounts effectively to enhance customer satisfaction and retention.<brbr>2. Finance<br> a. Financial Stability: Finance the company to ensure long-term sustainability and growth.<br><br>3. Account<br> a. Account Management: Manage accounts effectively to enhance customer satisfaction and retention.<br></p>”
{
"html": [
"<p>Vision: To create safe, broadly beneficial AI systems that ensure the advantages of artificial general intelligence (AGI) are shared equitably across society. Our vision emphasizes the importance of safety and alignment, ensuring that AI systems align with human values and remain under human control. We aspire to collaborate with other research and policy institutions to address global challenges associated with advanced AI, prioritizing the safe development of increasingly capable systems that act in the best interests of humanity.</p>",
"<p>Company Goals:</p><p>1. Audit Department:<br> a. Enhance Risk Management and Internal Controls: Strengthen the organizations risk posture by identifying, assessing, and recommending improvements to internal controls.<br> b. Ensure Regulatory and Policy Compliance: Monitor adherence to relevant laws, regulations, standards, and internal policies.<br> c. Support Organizational Governance: Provide independent assurance to senior management and the board on the effectiveness of governance processes.<br> d. Drive Operational Efficiency: Identify inefficiencies and areas for process improvement during audits.<br> e. Leverage Technology and Data Analytics: Use automated tools and analytics for continuous auditing and real-time risk monitoring.<br> f. Develop Audit Talent and Capabilities: Invest in training and upskilling for the audit team.<br> g. Enhance Stakeholder Communication: Improve reporting clarity, timeliness, and relevance to stakeholders.<br><br>2. Finance Department:<br> a. Ensure Financial Stability and Sustainability: Maintain strong cash flow and optimize working capital.<br> b. Improve Financial Planning and Analysis (FP&A): Provide accurate forecasting and budgeting to support strategic decision-making.<br> c. Enhance Cost Management and Operational Efficiency: Identify cost-saving opportunities and drive efficient use of financial resources.<br> d. Ensure Regulatory and Compliance Integrity: Maintain full compliance with financial regulations and internal controls.<br> e. Enable Strategic Investment and Capital Allocation: Evaluate and fund initiatives that align with the organizations long-term growth strategy.<br> f. Improve Financial Reporting and Transparency: Deliver timely and accurate financial reports for stakeholders.<br> g. Leverage Financial Technology and Automation: Implement tools to streamline financial operations.<br> h. Develop Finance Talent and Leadership: Upskill finance staff and promote cross-functional knowledge.<br><br>3. Account Department:<br> a. Maintain Accurate and Timely Financial Records: Ensure all transactions are recorded properly.<br> b. Ensure Regulatory and Tax Compliance: Comply with all financial regulations and timely tax filings.<br> c. Streamline Month-End and Year-End Closing Processes: Reduce the time and complexity of closing periods.<br> d. Support Strategic Financial Planning: Provide reliable data for budgeting and forecasting.<br> e. Implement Automation and Digital Tools: Use accounting software and RPA to increase efficiency.<br> f. Strengthen Internal Controls and Risk Management: Ensure robust controls over financial transactions.<br> g. Improve Financial Transparency and Reporting Quality: Produce clear and consistent reports for stakeholders.<br> h. Develop Accounting Team Skills and Expertise: Provide continuous learning and leadership development for accounting staff.<br></p>"
],
"department_goals": [
{
"department": "Account Management",
"goals": [
{
"goal_title": "Customer Satisfaction",
"goal_description": "Manage accounts effectively to enhance customer satisfaction and retention."
}
]
},
{
"department": "Finance",
"goals": [
{
"goal_title": "Financial Stability",
"goal_description": "Finance the company to ensure long-term sustainability and growth."
}
]
}
]
}
NOTE, VERY CRITICAL: FOLLOW THIS RESPONSE FORMAT STRICTLY , NOTHING BEFORE OR AFTER PLEASE !!!
""" """
''' def get_sop_executive_for_managers(): ''' def get_sop_executive_for_managers():
return Your task is to extract the "Vision", "Mission", and executive-generated Standard Operating Procedures (SOPs) specifically for managers from the provided document. return Your task is to extract the "Vision", "Mission", and executive-generated Standard Operating Procedures (SOPs) specifically for managers from the provided document.
@@ -221,8 +256,41 @@ def get_vision_mission_extraction_from_questionnaire_executive():
NOTE: ADHERE STRICTLY TO THIS OUTPUT FORMAT , DO NOT CHANGE IT PLEASE NOTE: ADHERE STRICTLY TO THIS OUTPUT FORMAT , DO NOT CHANGE IT PLEASE
**Example Output Format:** Two texts (one for vision and for goal) **Example Output Format:** Two texts (one for vision and for goal)
<p>Vision: To create a future where our organization is recognized for its contributions and effectiveness in achieving its goals.</p>" - Format your output with:
“<p>Company Goals:</p><p>1. Account Management: Manage accounts effectively to enhance customer satisfaction and retention.<brbr>2. Finance<br> a. Financial Stability: Finance the company to ensure long-term sustainability and growth.<br><br>3. Account<br> a. Account Management: Manage accounts effectively to enhance customer satisfaction and retention.<br></p>” - An **HTML section** for rendering on the frontend.
- A **structured JSON section** with department-wise goal breakdown.
**Example Output Format:**
{
"html": [
"<p>Vision: To create safe, broadly beneficial AI systems that ensure the advantages of artificial general intelligence (AGI) are shared equitably across society. Our vision emphasizes the importance of safety and alignment, ensuring that AI systems align with human values and remain under human control. We aspire to collaborate with other research and policy institutions to address global challenges associated with advanced AI, prioritizing the safe development of increasingly capable systems that act in the best interests of humanity.</p>",
"<p>Company Goals:</p><p>1. Audit Department:<br> a. Enhance Risk Management and Internal Controls: Strengthen the organizations risk posture by identifying, assessing, and recommending improvements to internal controls.<br> b. Ensure Regulatory and Policy Compliance: Monitor adherence to relevant laws, regulations, standards, and internal policies.<br> c. Support Organizational Governance: Provide independent assurance to senior management and the board on the effectiveness of governance processes.<br> d. Drive Operational Efficiency: Identify inefficiencies and areas for process improvement during audits.<br> e. Leverage Technology and Data Analytics: Use automated tools and analytics for continuous auditing and real-time risk monitoring.<br> f. Develop Audit Talent and Capabilities: Invest in training and upskilling for the audit team.<br> g. Enhance Stakeholder Communication: Improve reporting clarity, timeliness, and relevance to stakeholders.<br><br>2. Finance Department:<br> a. Ensure Financial Stability and Sustainability: Maintain strong cash flow and optimize working capital.<br> b. Improve Financial Planning and Analysis (FP&A): Provide accurate forecasting and budgeting to support strategic decision-making.<br> c. Enhance Cost Management and Operational Efficiency: Identify cost-saving opportunities and drive efficient use of financial resources.<br> d. Ensure Regulatory and Compliance Integrity: Maintain full compliance with financial regulations and internal controls.<br> e. Enable Strategic Investment and Capital Allocation: Evaluate and fund initiatives that align with the organizations long-term growth strategy.<br> f. Improve Financial Reporting and Transparency: Deliver timely and accurate financial reports for stakeholders.<br> g. Leverage Financial Technology and Automation: Implement tools to streamline financial operations.<br> h. Develop Finance Talent and Leadership: Upskill finance staff and promote cross-functional knowledge.<br><br>3. Account Department:<br> a. Maintain Accurate and Timely Financial Records: Ensure all transactions are recorded properly.<br> b. Ensure Regulatory and Tax Compliance: Comply with all financial regulations and timely tax filings.<br> c. Streamline Month-End and Year-End Closing Processes: Reduce the time and complexity of closing periods.<br> d. Support Strategic Financial Planning: Provide reliable data for budgeting and forecasting.<br> e. Implement Automation and Digital Tools: Use accounting software and RPA to increase efficiency.<br> f. Strengthen Internal Controls and Risk Management: Ensure robust controls over financial transactions.<br> g. Improve Financial Transparency and Reporting Quality: Produce clear and consistent reports for stakeholders.<br> h. Develop Accounting Team Skills and Expertise: Provide continuous learning and leadership development for accounting staff.<br></p>"
],
"department_goals": [
{
"department": "Account Management",
"goals": [
{
"goal_title": "Customer Satisfaction",
"goal_description": "Manage accounts effectively to enhance customer satisfaction and retention."
}
]
},
{
"department": "Finance",
"goals": [
{
"goal_title": "Financial Stability",
"goal_description": "Finance the company to ensure long-term sustainability and growth."
}
]
}
]
}
NOTE: FOLLOW THIS RESPONSE FORMAT STRICTLY , NOTHING BEFORE OR AFTER PLEASE !!!
""" """
+4 -3
View File
@@ -106,10 +106,11 @@ class DocumentParser:
""" """
try: try:
MODEL = "gpt-4o"
docs_text = self._extract_text_from_docs(docs) docs_text = self._extract_text_from_docs(docs)
prompt = get_vision_mission_extraction_from_doc2() prompt = get_vision_mission_extraction_from_doc2()
response = self.client.beta.chat.completions.parse( response = self.client.beta.chat.completions.parse(
model=self.model, model=MODEL,
messages=[ messages=[
{ {
"role": "system", "role": "system",
@@ -124,8 +125,8 @@ class DocumentParser:
"content": [{"type": "text", "text": text} for text in docs_text], "content": [{"type": "text", "text": text} for text in docs_text],
} }
], ],
response_format=VisionMissionResponse2, response_format=VisionMissionResponseV3,
max_tokens=10000, max_tokens=8000,
temperature=0.1 temperature=0.1
) )
+1 -1
View File
@@ -307,7 +307,7 @@ class SopGeneratorExecutive:
{"role": "system", "content": prompt}, {"role": "system", "content": prompt},
{"role": "user", "content": f"questionnaire response:\n{user_content}"} {"role": "user", "content": f"questionnaire response:\n{user_content}"}
], ],
response_format=VisionMissionResponse2, response_format=VisionMissionResponseV3,
max_tokens=16000, max_tokens=16000,
temperature=0.1 temperature=0.1
) )
Binary file not shown.