Files
erp-ai-latest/test.py
T

73 lines
2.6 KiB
Python
Raw Normal View History

2024-09-10 02:51:31 +01:00
import json
from src.services.questions_generator import QuestionsGenerator
2024-09-10 02:51:31 +01:00
# Mocking the SOPs input as described in your example
mock_sops_input = {
"sops": {
"departments": [
2024-09-10 01:00:08 +01:00
{
2024-09-10 02:51:31 +01:00
"name": "Accounts Receivable",
"workers": [
{
"name": "Angela Lewis",
"position": "AR Director",
"sops": {
"must": [],
"shall": [],
"will": []
}
},
{
"name": "Jamie Vega",
"position": "AR Supervisor",
"sops": {
"must": [
"Provide escalation information to the AR Director if additional escalations are needed."
],
"shall": [],
"will": []
}
},
{
"name": "Jessica Merzougui",
"position": "AR Supervisor",
"sops": {
"must": [
"Provide escalation information to the AR Director if additional escalations are needed."
],
"shall": [],
"will": []
}
},
{
"name": "Deniece Santos",
"position": "AR Analyst",
"sops": {
"must": [],
"shall": [],
"will": []
}
}
]
2024-09-10 01:00:08 +01:00
}
2024-09-10 02:51:31 +01:00
]
}
}
# Defining the full input data including additional parameters
input_data = {
"sops": json.dumps(mock_sops_input), # Convert SOPs to JSON string format
"assessment_type": "progress", # Set the assessment type
"frequency_type": "weekly", # Set the frequency type (daily, weekly, etc.)
"duration": 4 # Set the duration (number of frequency cycles, e.g., 4 weeks)
}
# Initialize the QuestionsGenerator
generator = QuestionsGenerator()
2024-09-10 01:00:08 +01:00
2024-09-10 02:51:31 +01:00
# Invoke the generate_questions method with the mock input
questions_response = generator.generate_questions(input_data)
2024-09-10 02:51:31 +01:00
# Print the generated questions response
print(json.dumps(questions_response, indent=4))