From 0568e697d15410f1066244171e835ccc65a8989a Mon Sep 17 00:00:00 2001 From: pawito236 Date: Thu, 28 Nov 2024 16:48:28 +0700 Subject: [PATCH] fix: running priority --- internal/roadmap_agent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/roadmap_agent.py b/internal/roadmap_agent.py index 4a119fb..1e87dee 100644 --- a/internal/roadmap_agent.py +++ b/internal/roadmap_agent.py @@ -316,12 +316,15 @@ def validated_roadmap_course(courses: List[Any], validated_roadmap: List[Dict[st seen_ids = set() unique_courses = [] total_duration = 0 + current_priority = 1 for course in validated_roadmap: if course["id"] in valid_course_ids and course["id"] not in seen_ids: + course['priority'] = current_priority unique_courses.append(course) seen_ids.add(course["id"]) total_duration += course["duration"] + current_priority+=1 return unique_courses, total_duration