ishaq101 commited on
Commit
fc8eb3c
Β·
1 Parent(s): abc3feb

[NOTICKET] Add field criteria_id in scoring v2 endpoitn

Browse files
README.md CHANGED
@@ -7,8 +7,6 @@ sdk: docker
7
  app_port: 7860
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
11
-
12
  ## Schemas
13
  ```plain
14
  1. Build Schema
@@ -126,41 +124,36 @@ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-
126
  ## List API
127
  ### User
128
  ```plain
129
- 1. create user βœ…
130
- 2. get user by username βœ…
131
- 3. login #TODO
132
  ```
133
  ### Tenant
134
  ```plain
135
- 1. create tenant βœ…
136
- 2. get tenant by tenant_name βœ…
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  ```
138
-
139
- ## Create User Example
140
- Input:
141
- {
142
- "username": "harryyanto.ia@bukittechnology.com",
143
- "password": "Test12345$!",
144
- "email": "harryyanto.ia@bukittechnology.com",
145
- "full_name": "Harryyanto Ishaq Agasi",
146
- "role": "Admin",
147
- "tenant_id": "03ce53dd-9fc8-43e0-b047-c927602304a9",
148
- "notes": "admin"
149
- }
150
-
151
- Output:
152
- {
153
- "user_id": "eb3de1ed-2e3f-4c95-b29b-b31f85f01730",
154
- "username": "harryyanto.ia@bukittechnology.com",
155
- "email": "harryyanto.ia@bukittechnology.com",
156
- "full_name": "Harryyanto Ishaq Agasi",
157
- "role": "Admin",
158
- "is_active": true,
159
- "tenant_id": "03ce53dd-9fc8-43e0-b047-c927602304a9",
160
- "created_at": "2026-02-19T15:42:05.726988Z"
161
- }
162
-
163
-
164
 
165
  ## How To
166
  1. Init schema on DB
 
7
  app_port: 7860
8
  ---
9
 
 
 
10
  ## Schemas
11
  ```plain
12
  1. Build Schema
 
124
  ## List API
125
  ### User
126
  ```plain
127
+ POST /admin/users βœ… Create user
128
+ POST /admin/login βœ… Login, returns JWT Bearer token
129
+ GET /admin/me βœ… Get current authenticated user
130
  ```
131
  ### Tenant
132
  ```plain
133
+ POST /admin/tenants βœ… Create tenant
134
+ GET /admin/tenants/{name} βœ… Get tenant by name
135
+ ```
136
+ ### File
137
+ ```plain
138
+ POST /file/upload βœ… Upload multiple PDF files
139
+ GET /file/user/{user_id} βœ… Get file metadata by user
140
+ DELETE /file/{filename} βœ… Soft-delete file (marks is_deleted=True)
141
+ GET /file/score_card βœ… Dashboard summary (total files, extracted profiles, %)
142
+ ```
143
+ ### Profile
144
+ ```plain
145
+ POST /profile/extract_profile βœ… Extract structured profile from a CV PDF
146
+ GET /profile/{profile_id} βœ… Get extracted profile by ID
147
+ GET /profile/profiles/{criteria_id} βœ… Get profiles by criteria ID
148
+ ```
149
+ ### Agentic
150
+ ```plain
151
+ POST /agentic/create_filter βœ… Create filter/criteria
152
+ GET /agentic/filter/{criteria_id} βœ… Get filter by ID
153
+ POST /agentic/create_weight βœ… Create weight config for scoring
154
+ POST /agentic/calculate_score ⚠️ DEPRECATED Old single scoring endpoint
155
+ POST /agentic/v2/calculate_score βœ… Bulk scoring (v2, recommended)
156
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
  ## How To
159
  1. Init schema on DB
interfaces/api/agentic.py CHANGED
@@ -142,6 +142,7 @@ async def create_weight(
142
  )
143
 
144
 
 
145
  @router.post("/calculate_score")
146
  async def calculate_score(
147
  weight_id: str,
 
142
  )
143
 
144
 
145
+ # DEPRECATED
146
  @router.post("/calculate_score")
147
  async def calculate_score(
148
  weight_id: str,
services/agentic/profile_scoring.py CHANGED
@@ -592,14 +592,10 @@ class AgenticScoringService:
592
  # Create criteria_id
593
  filter_svc = AgenticFilterService(db=self.db, user=self.user)
594
  criteria = requirements.get("criteria")
595
- print(f"DEBUG: scoring_v2/criteria: {criteria}")
596
 
597
  weight = requirements.get("criteria_weight")
598
- print(f"DEBUG: scoring_v2/weight: {weight}")
599
 
600
  criteria_id = await filter_svc.create_filter_v2(filter=criteria)
601
- print(f"DEBUG: scoring_v2/criteria_id: {criteria_id}")
602
-
603
 
604
  weight_svc = AgenticWeightService(db=self.db, user=self.user)
605
  cv_weight = CVWeight(
@@ -668,7 +664,10 @@ class AgenticScoringService:
668
  # Insert Score Result to DB
669
  scores = await create_scores(self.db, score_results)
670
 
671
- return scores
 
 
 
672
  except Exception as E:
673
  logger.error(f"profile scoring v2 error, {E}")
674
  traceback.print_exc()
 
592
  # Create criteria_id
593
  filter_svc = AgenticFilterService(db=self.db, user=self.user)
594
  criteria = requirements.get("criteria")
 
595
 
596
  weight = requirements.get("criteria_weight")
 
597
 
598
  criteria_id = await filter_svc.create_filter_v2(filter=criteria)
 
 
599
 
600
  weight_svc = AgenticWeightService(db=self.db, user=self.user)
601
  cv_weight = CVWeight(
 
664
  # Insert Score Result to DB
665
  scores = await create_scores(self.db, score_results)
666
 
667
+ return {
668
+ "criteria_id":criteria_id,
669
+ "scores":scores
670
+ }
671
  except Exception as E:
672
  logger.error(f"profile scoring v2 error, {E}")
673
  traceback.print_exc()