mirror of
https://github.com/SkalaraAI/management-llm.git
synced 2025-04-09 15:00:19 -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'])
|
||||
def assign_tasks_to_users():
|
||||
# try:
|
||||
data = request.get_json()
|
||||
tasks = data[0]['tasks']
|
||||
users = data[0]['users']
|
||||
result = {}
|
||||
try:
|
||||
data = request.get_json()
|
||||
tasks = data[0]['tasks']
|
||||
users = data[0]['users']
|
||||
result = {}
|
||||
|
||||
tasks_dict = {}
|
||||
users_dict = {}
|
||||
tasks_dict = {}
|
||||
users_dict = {}
|
||||
|
||||
for task, task_description in tasks.items():
|
||||
tasks_dict[task_description["id"]] = {"tags" : generate_technical_tags(task_description["content"]), "complexity" : task_description["complexityScore"]}
|
||||
for task, task_description in tasks.items():
|
||||
tasks_dict[task_description["id"]] = {"tags" : generate_technical_tags(task_description["content"]), "complexity" : task_description["complexityScore"]}
|
||||
|
||||
for user, user_description in users.items():
|
||||
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 = {}
|
||||
# for task, task_description in tasks.items():
|
||||
# result[task_description["content"]] = {"assignedTo" : matchings[task_description["id"]]}
|
||||
|
||||
# print(result)
|
||||
result = matching
|
||||
return jsonify(result)
|
||||
# return result
|
||||
# except Exception as e:
|
||||
# return jsonify({"error": str(e)}), 500
|
||||
for user, user_description in users.items():
|
||||
users_dict[user_description["id"]] = {"strengths" : user_description["strengths"], "current_tasks" : user_description["currentTasks"]}
|
||||
|
||||
|
||||
result = match_tasks_to_users(tasks_dict, users_dict, 3)
|
||||
return jsonify(result)
|
||||
except Exception as e:
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue
Block a user