added managers apis

This commit is contained in:
OwusuBlessing
2024-09-10 01:00:08 +01:00
parent 0d8ad2381b
commit 286ff0e61e
7 changed files with 371 additions and 213 deletions
+69 -11
View File
@@ -129,6 +129,39 @@ def get_departments_managers_workers_extraction_prompt():
If no departments, managers, or workers are found in the document, return an empty list for departments.
"""
def get_managers_workers_extraction_prompt():
return """
Extract only the managers and workers from the document.
For each manager, include their name, position, role, and key responsibilities.
Additionally, for each worker, extract their name, position, and list 1-2 key responsibilities.
Do not add any managers or workers that are not explicitly mentioned in the document.
Managers: Include the managers (e.g., Department Head, Manager), their role, and key responsibilities.
- **PRP (Primary Responsible Person)**: A manager who has primary responsibility for decision-making and overseeing operations.
- **SRP (Secondary Responsible Person)**: A manager who supports the PRP, often assisting with tasks and providing backup in decision-making.
Format as JSON:
{
"managers": [
{
"name": "Manager Name",
"position": "Manager Position",
"role": "PRP or SRP", # The classification field either PRP or SRP
"responsibilities": ["Key Responsibility 1", "Key Responsibility 2"]
}
],
"workers": [
{
"name": "Worker Name",
"position": "Worker Position",
"responsibilities": ["Key Responsibility 1", "Key Responsibility 2"]
}
]
}
If no managers or workers are found in the document, return an empty list for them.
"""
@@ -202,23 +235,17 @@ def get_sop_executive_from_questionnaire():
Ensure that each specified department has its own set of SOPs.
'''
def generate_llm_comparison_prompt(reference_roles, extracted_managers):
reference_roles_str = ', '.join(reference_roles)
extracted_managers_str = '\n'.join([f"- {manager['name']} (Position: {manager['position']}, Role: {manager['role']})" for manager in extracted_managers])
prompt = f"""
def get_roles_reference_comparison():
prompt = """
You are tasked with comparing a list of reference roles with the extracted roles from a document.
Reference roles:
[{reference_roles_str}]
Extracted roles:
{extracted_managers_str}
Please classify the roles into the following categories:
1. **Assigned Roles**: Roles that are found in both the reference list and the extracted list.
2. **Unassigned Roles**: Roles that are found in the reference list but not in the extracted list.
3. **Unavailable Roles**: Roles that are found in the extracted list but not in the reference list.
Instruction:
1. Use only the position to judge the extraction.
Return the result in the following JSON format:
{
@@ -234,3 +261,34 @@ def generate_llm_comparison_prompt(reference_roles, extracted_managers):
}
"""
return prompt
def get_sop_for_department_workers():
return '''Generate SOPs for each worker under the unique department based on the information the workers info provided
Instructions:
1. Focus on the provided department and worker role.
2. Categorize SOPs into "must," "shall," and "will."
3. SOPs should be actionable and relevant to the worker's duties.
4. If no SOPs can be generated, return empty lists for each category.
5. Use the provided document and the workers and department information to generate the SOP.
6. If the provided document cannot provide SOPs for a specific worker stated, then return an empty list for the SOP for that worker.
Example format:
{
"departments": [
{
"name": "Department A",
"workers": [
{
"name": "Worker A",
"must": ["Conduct weekly meetings"],
"shall": ["Submit monthly reports"],
"will": ["Improve efficiency"]
}
]
}
]
}s
'''