Spaces:
Sleeping
Sleeping
[NOTICKET] Add new endpoint /v2/calculate_score
Browse files
services/agentic/profile_scoring.py
CHANGED
|
@@ -586,7 +586,35 @@ class AgenticScoringService:
|
|
| 586 |
try:
|
| 587 |
# Create criteria_id
|
| 588 |
filter_svc = AgenticFilterService(db=self.db, user=self.user)
|
| 589 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 590 |
weight_svc = AgenticWeightService(db=self.db, user=self.user)
|
| 591 |
cv_weight = CVWeight(
|
| 592 |
criteria_id=criteria_id,
|
|
@@ -612,11 +640,10 @@ class AgenticScoringService:
|
|
| 612 |
certifications=weight.get("certifications"),
|
| 613 |
business_domain=weight.get("business_domain")
|
| 614 |
)
|
|
|
|
| 615 |
weight_output = await weight_svc.create_weight(weight=cv_weight)
|
| 616 |
weight_id = weight_output.get("weight_id")
|
| 617 |
|
| 618 |
-
criteria = requirements.criteria
|
| 619 |
-
weight = requirements.criteria_weight
|
| 620 |
|
| 621 |
all_profiles = await get_profiles_by_user_id(db=self.db, current_user=self.user)
|
| 622 |
print(f"🫡 Found {len(all_profiles)} profiles to be scored")
|
|
|
|
| 586 |
try:
|
| 587 |
# Create criteria_id
|
| 588 |
filter_svc = AgenticFilterService(db=self.db, user=self.user)
|
| 589 |
+
criteria = requirements.get("criteria")
|
| 590 |
+
weight = requirements.get("criteria_weight")
|
| 591 |
+
|
| 592 |
+
cv_filter = CVFilter(
|
| 593 |
+
criteria_id=uuid4(),
|
| 594 |
+
|
| 595 |
+
gpa_edu_1=filter.get("gpa_edu_1"),
|
| 596 |
+
gpa_edu_2=filter.get("gpa_edu_2"),
|
| 597 |
+
gpa_edu_3=filter.get("gpa_edu_3"),
|
| 598 |
+
|
| 599 |
+
univ_edu_1=filter.get("univ_edu_1"),
|
| 600 |
+
univ_edu_2=filter.get("univ_edu_2"),
|
| 601 |
+
univ_edu_3=filter.get("univ_edu_3"),
|
| 602 |
+
|
| 603 |
+
major_edu_1=filter.get("major_edu_1"),
|
| 604 |
+
major_edu_2=filter.get("major_edu_2"),
|
| 605 |
+
major_edu_3=filter.get("major_edu_3"),
|
| 606 |
+
|
| 607 |
+
domicile=filter.get("domicile"),
|
| 608 |
+
yoe=filter.get("yoe"),
|
| 609 |
+
|
| 610 |
+
hardskills=filter.get("hardskills"),
|
| 611 |
+
softskills=filter.get("softskills"),
|
| 612 |
+
certifications=filter.get("certifications"),
|
| 613 |
+
business_domain=filter.get("business_domain")
|
| 614 |
+
)
|
| 615 |
+
criteria_id = await filter_svc.create_filter(filter=cv_filter)
|
| 616 |
+
|
| 617 |
+
|
| 618 |
weight_svc = AgenticWeightService(db=self.db, user=self.user)
|
| 619 |
cv_weight = CVWeight(
|
| 620 |
criteria_id=criteria_id,
|
|
|
|
| 640 |
certifications=weight.get("certifications"),
|
| 641 |
business_domain=weight.get("business_domain")
|
| 642 |
)
|
| 643 |
+
|
| 644 |
weight_output = await weight_svc.create_weight(weight=cv_weight)
|
| 645 |
weight_id = weight_output.get("weight_id")
|
| 646 |
|
|
|
|
|
|
|
| 647 |
|
| 648 |
all_profiles = await get_profiles_by_user_id(db=self.db, current_user=self.user)
|
| 649 |
print(f"🫡 Found {len(all_profiles)} profiles to be scored")
|