updated
This commit is contained in:
+104
-56
@@ -17,61 +17,26 @@ def validate_worker_prompt() -> str:
|
||||
result:"validated"
|
||||
}
|
||||
"""
|
||||
|
||||
def predict_based_past_assessment_prompt(query,company_info, summary_stats):
|
||||
# Extract company information from the dictionary
|
||||
company_name = company_info['company_name']
|
||||
company_size = company_info['company_size']
|
||||
departments = company_info['departments']
|
||||
|
||||
|
||||
# Create the prompt with the provided company info and summary statistics
|
||||
prompt = f"""
|
||||
**Prompt for the Chatbot:**
|
||||
|
||||
**Context:**
|
||||
You are an AI assistant working for {company_name}, and your primary responsibility is to provide **insights**, **predictions**, and **recommendations** based on the company's past assessment data and organizational structure. You are not allowed to respond to any queries outside of this domain.
|
||||
You are an AI assistant and work as assessment anaylyst, and your primary responsibility is to provide **insights**, **predictions**, and **recommendations** based on the company's past assessment data and organizational structure. You are not allowed to respond to any queries outside of this domain.
|
||||
|
||||
**General Company Information:**
|
||||
- **Company Name**: {company_name}
|
||||
- **Company Size**: {company_size} (e.g., Small, Medium, Large)
|
||||
- **Departments**:
|
||||
{', '.join(departments)}
|
||||
Company info is {company_info}
|
||||
|
||||
**Assessment Summary**:
|
||||
The following is a detailed summary of past assessments at {company_name}. Use this information to provide predictions and recommendations based on trends and data points.
|
||||
The following is a detailed summary of past assessments will be provided. Use this information to provide predictions and recommendations based on trends and data points.
|
||||
|
||||
- **Open Items and Red Flags**:
|
||||
- Total Open Items: {summary_stats['Open Items and Red Flags']['Total Open Items']}
|
||||
- Average Open Items per Assessment: {summary_stats['Open Items and Red Flags']['Average Open Items per Assessment']}
|
||||
- Total Red Flags: {summary_stats['Open Items and Red Flags']['Total Red Flags']}
|
||||
- Average Red Flags per Assessment: {summary_stats['Open Items and Red Flags']['Average Red Flags per Assessment']}
|
||||
- Max Red Flags in a Single Assessment: {summary_stats['Open Items and Red Flags']['Max Red Flags in a Single Assessment']}
|
||||
- Most Common Area with Red Flags: {summary_stats['Open Items and Red Flags']['Most Common Area with Red Flags']}
|
||||
|
||||
- **Assessment Frequency**:
|
||||
- Weekly: {summary_stats['Assessment Frequency']['Assessment Type Breakdown'].get('Weekly', 0) * 100}%
|
||||
- Bi-Weekly: {summary_stats['Assessment Frequency']['Assessment Type Breakdown'].get('Bi-Weekly', 0) * 100}%
|
||||
- Quarterly: {summary_stats['Assessment Frequency']['Assessment Type Breakdown'].get('Quarterly', 0) * 100}%
|
||||
- Average Time Between Assessments: {summary_stats['Assessment Frequency']['Average Time Between Assessments']} days
|
||||
- Average Assessment Duration: {summary_stats['Assessment Frequency']['Average Assessment Duration']} days
|
||||
Past assessment summary : {summary_stats}
|
||||
|
||||
- **Assessment Start and End Dates**:
|
||||
- Longest Assessment Duration: {summary_stats['Assessment Start and End Dates']['Longest Assessment Duration (days)']} days
|
||||
- Shortest Assessment Duration: {summary_stats['Assessment Start and End Dates']['Shortest Assessment Duration (days)']} days
|
||||
|
||||
- **Assessment Areas**:
|
||||
- Most Assessed Area: {summary_stats['Assessment Areas']['Most Assessed Area']}
|
||||
- Most Open Items in Area: {summary_stats['Assessment Areas']['Most Open Items in Area']}
|
||||
- Area with Most Red Flags: {summary_stats['Assessment Areas']['Area with Most Red Flags']}
|
||||
|
||||
- **Assessment Status**:
|
||||
- Completed: {summary_stats['Assessment Status']['Assessment Status Distribution'].get('Completed', 0) * 100}%
|
||||
- In Progress: {summary_stats['Assessment Status']['Assessment Status Distribution'].get('In Progress', 0) * 100}%
|
||||
- Incomplete: {summary_stats['Assessment Status']['Assessment Status Distribution'].get('Incomplete', 0) * 100}%
|
||||
|
||||
- **Assessment Admin**:
|
||||
- Most Frequent Admin: {summary_stats['Assessment Admin']['Most Frequent Admin']}
|
||||
- Admin with Fewest Red Flags: {summary_stats['Assessment Admin']['Admin with Fewest Red Flags']}
|
||||
- Admin with Most Open Items: {summary_stats['Assessment Admin']['Admin with Most Open Items']}
|
||||
|
||||
**Instructions:**
|
||||
Use the above information to answer user queries. You should:
|
||||
@@ -102,38 +67,38 @@ def predict_next_n_assessments_prompt():
|
||||
**Prompt for the Chatbot:**
|
||||
|
||||
**Context:**
|
||||
You are an AI assistant responsible for analyzing the past assessment data of , and your primary responsibility is to provide **predictions** for the next {n} assessments.
|
||||
These assessments can occur on a **weekly**, **bi-weekly**, or **quarterly** basis. Use the company's past performance to predict the following for each of the next {n} assessments:
|
||||
You are an AI assistant responsible for thoroughly analyzing the past assessment data of a company. Your primary responsibility is to provide **dynamic predictions** for the next {n} assessments, considering different scenarios based on the frequency of assessments: **weekly**, **bi-weekly**, or **quarterly**. Use the company's past performance to predict the following for each of the next {n} assessments:
|
||||
- **Number of Open Items**.
|
||||
- **Number of Red Flags**.
|
||||
- **Predictions for Weekly, Bi-Weekly, and Quarterly assessments**.
|
||||
input :
|
||||
- company basic info
|
||||
- past assessment statitics
|
||||
|
||||
**Input:**
|
||||
- Company basic info
|
||||
- Past assessment statistics
|
||||
- N - number of next assessments to be predicted
|
||||
|
||||
**General Company Information:**
|
||||
|
||||
|
||||
**Assessment Summary (Past Data)**:
|
||||
The Detailed information on past asssessment will be provided. Use this information to make predictions for the next {n} assessments.
|
||||
|
||||
Detailed information on past assessments will be provided. Use this information to make informed predictions for the next {n} assessments, taking into account the frequency of assessments.
|
||||
|
||||
**Instructions**:
|
||||
- Predict the number of open items and red flags for the next n assessments if they are conducted on a weekly, bi-weekly, or quarterly basis.
|
||||
- Use the historical summary statistics provided above to guide your predictions.
|
||||
- Analyze the historical data to predict the number of open items and red flags for the next n assessments based on whether they are conducted weekly, bi-weekly, or quarterly.
|
||||
- Consider the implications of each frequency on the predictions, and ensure your analysis reflects the potential outcomes for each scenario.
|
||||
- Return the response in the following JSON format:
|
||||
|
||||
**Response Format**:
|
||||
|
||||
{
|
||||
"assessment 1": [
|
||||
"assessment_1": [
|
||||
{
|
||||
"weekly": {"open_items": X, "red_flags": Y}},
|
||||
"biweekly": {{"open_items": X, "red_flags": Y}},
|
||||
"quarterly": {{"open_items": X, "red_flags": Y}}
|
||||
"weekly": {"open_items": X, "red_flags": Y},
|
||||
"biweekly": {"open_items": X, "red_flags": Y},
|
||||
"quarterly": {"open_items": X, "red_flags": Y}
|
||||
}
|
||||
],
|
||||
"assessment 2": [
|
||||
"assessment_2": [
|
||||
{
|
||||
"weekly": {"open_items": X, "red_flags": Y},
|
||||
"biweekly": {"open_items": X, "red_flags": Y},
|
||||
@@ -143,12 +108,95 @@ def predict_next_n_assessments_prompt():
|
||||
// assuming N is 2
|
||||
}
|
||||
```
|
||||
Ensure each assessment is provided with three predictions: one for Weekly, one for Bi-Weekly, and one for Quarterly assessments.
|
||||
Ensure each assessment is provided with three predictions: one for Weekly, one for Bi-Weekly, and one for Quarterly assessments, and analyze the data dynamically to reflect the different scenarios.
|
||||
"""
|
||||
|
||||
return prompt
|
||||
|
||||
|
||||
def predict_next_n_assessments_prompt_v2():
|
||||
prompt = """
|
||||
You are an AI analyst specializing in company team assessments. Using the provided summary statistics, predict the next N assessments.
|
||||
|
||||
**Input:**
|
||||
1. Summary Statistics containing:
|
||||
- Total assessments completed
|
||||
- Average open/completed items per assessment
|
||||
- User efficiency metrics
|
||||
- Area-based statistics
|
||||
- Red flag distributions
|
||||
- Team completion rates
|
||||
2. N: number of future assessments to predict
|
||||
|
||||
**Validation Rules:**
|
||||
1. Ensure summary statistics are complete and consistent
|
||||
2. Check number of historical assessments:
|
||||
- If only 1 assessment: Mark as "invalid" with reason explaining need for more data
|
||||
- If 2+ assessments: Proceed with predictions
|
||||
3. Verify that area-based stats align with overall metrics
|
||||
|
||||
**Analysis Instructions:**
|
||||
1. Use the average metrics as baseline predictions
|
||||
2. Adjust predictions based on:
|
||||
- Current completion rates per user
|
||||
- Area-specific trends in open items and red flags
|
||||
- Distribution of work across different areas
|
||||
- Historical red flag patterns
|
||||
3. Consider frequency impacts:
|
||||
- Weekly: More frequent checks = faster issue detection and resolution
|
||||
- Biweekly: Moderate item accumulation
|
||||
- Quarterly: Longer accumulation period but more time for resolution
|
||||
|
||||
**Output Format:**
|
||||
{
|
||||
"state": "valid" | "invalid",
|
||||
"reason": string | null, // Required if state is "invalid"
|
||||
"predictions": [
|
||||
{
|
||||
"assessment_1": {
|
||||
"weekly": {
|
||||
"open_items": number,
|
||||
"red_flags": number
|
||||
},
|
||||
"biweekly": {
|
||||
"open_items": number,
|
||||
"red_flags": number
|
||||
},
|
||||
"quarterly": {
|
||||
"open_items": number,
|
||||
"red_flags": number
|
||||
}
|
||||
}
|
||||
},
|
||||
// ... N predictions
|
||||
]
|
||||
}
|
||||
|
||||
NOTE: Do not add extra anything also any ``JSON`` formatter tags. Only output JSON.
|
||||
|
||||
Use the following guidelines for predictions:
|
||||
1. Weekly predictions should be based on:
|
||||
- avg_open_items_per_assessment
|
||||
- completion_rate_per_user
|
||||
- current area-based distribution of open items
|
||||
|
||||
2. Biweekly predictions should consider:
|
||||
- Accumulation over two weeks
|
||||
- Historical completion patterns
|
||||
- Area-specific red flag frequencies
|
||||
|
||||
3. Quarterly predictions should account for:
|
||||
- Longer-term accumulation patterns
|
||||
- Team efficiency metrics
|
||||
- Historical area-based completion rates
|
||||
|
||||
Make predictions that reflect realistic patterns based on the team's performance metrics and area-specific challenges.
|
||||
"""
|
||||
return prompt
|
||||
|
||||
|
||||
|
||||
|
||||
def recommend_assessment_frequency_prompt():
|
||||
return '''
|
||||
You are provided with the Standard Operating Procedures (SOPs) for various roles within a company, along with options (e.g., ['weekly', 'monthly', 'biweekly']) for how frequently assessments should be performed. Your task is to recommend the best assessment type and frequency (weekly, biweekly, or quarterly) for all employees, based on the overall nature of the SOPs.
|
||||
|
||||
Reference in New Issue
Block a user