mirror of
https://github.com/SkalaraAI/management-llm.git
synced 2025-04-17 19:00:16 -04:00
style changes
This commit is contained in:
parent
403a489176
commit
0b98ac5dbc
|
@ -95,33 +95,26 @@ def get_task_tags():
|
||||||
|
|
||||||
@app.route('/assign_tasks', methods=['POST'])
|
@app.route('/assign_tasks', methods=['POST'])
|
||||||
def assign_tasks_to_users():
|
def assign_tasks_to_users():
|
||||||
# try:
|
try:
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
tasks = data[0]['tasks']
|
tasks = data[0]['tasks']
|
||||||
users = data[0]['users']
|
users = data[0]['users']
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
tasks_dict = {}
|
tasks_dict = {}
|
||||||
users_dict = {}
|
users_dict = {}
|
||||||
|
|
||||||
for task, task_description in tasks.items():
|
for task, task_description in tasks.items():
|
||||||
tasks_dict[task_description["id"]] = {"tags" : generate_technical_tags(task_description["content"]), "complexity" : task_description["complexityScore"]}
|
tasks_dict[task_description["id"]] = {"tags" : generate_technical_tags(task_description["content"]), "complexity" : task_description["complexityScore"]}
|
||||||
|
|
||||||
for user, user_description in users.items():
|
for user, user_description in users.items():
|
||||||
users_dict[user_description["id"]] = {"strengths" : user_description["strengths"], "current_tasks" : user_description["currentTasks"]}
|
users_dict[user_description["id"]] = {"strengths" : user_description["strengths"], "current_tasks" : user_description["currentTasks"]}
|
||||||
|
|
||||||
|
|
||||||
matching = match_tasks_to_users(tasks_dict, users_dict, 3)
|
result = match_tasks_to_users(tasks_dict, users_dict, 3)
|
||||||
# result = {}
|
return jsonify(result)
|
||||||
# for task, task_description in tasks.items():
|
except Exception as e:
|
||||||
# result[task_description["content"]] = {"assignedTo" : matchings[task_description["id"]]}
|
return jsonify({"error": str(e)}), 500
|
||||||
|
|
||||||
# print(result)
|
|
||||||
result = matching
|
|
||||||
return jsonify(result)
|
|
||||||
# return result
|
|
||||||
# except Exception as e:
|
|
||||||
# return jsonify({"error": str(e)}), 500
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user