aidlmrza commited on
Commit
92525a0
·
verified ·
1 Parent(s): efa350e

Update app/main.py

Browse files
Files changed (1) hide show
  1. app/main.py +6 -6
app/main.py CHANGED
@@ -75,7 +75,7 @@ def load_models():
75
  print(f"👉 Pastikan folder 'model_artifacts' ada di: {base_dir}")
76
 
77
  # --- 2. ENDPOINT REKOMENDASI (ML POWERED) ---
78
- @app.post("/recommendations", response_model=List[schemas.RecommendationItem])
79
  async def generate_recommendations(req: schemas.UserProfile):
80
 
81
  user_data = req.model_dump() if hasattr(req, 'model_dump') else req.dict()
@@ -88,7 +88,7 @@ async def generate_recommendations(req: schemas.UserProfile):
88
  # --- 3. ENDPOINT CHAT ROUTER ---
89
  # app/main.py (Bagian process_chat saja)
90
 
91
- @app.post("/chat/process", response_model=schemas.ChatResponse)
92
  async def process_chat(req: schemas.ChatRequest):
93
  available_skill_names = []
94
  role_data = None
@@ -233,7 +233,7 @@ async def process_chat(req: schemas.ChatRequest):
233
  )
234
 
235
 
236
- @app.post("/exam/submit", response_model=schemas.EvaluationResponse)
237
  async def submit_exam(sub: schemas.AnswerSubmission):
238
  evaluation = await llm_engine.evaluate_answer(
239
  user_answer=sub.user_answer,
@@ -255,7 +255,7 @@ async def submit_exam(sub: schemas.AnswerSubmission):
255
  )
256
 
257
  # --- 5. ENDPOINT PROGRESS ---
258
- @app.post("/progress/analyze")
259
  async def get_progress_analysis(data: schemas.ProgressData):
260
  # Konversi objek Pydantic ke Dictionary biasa
261
  progress_dict = data.dict()
@@ -272,12 +272,12 @@ async def get_progress_analysis(data: schemas.ProgressData):
272
  # ENDPOINT PSIKOLOGI (JOB ROLE TEST)
273
  # ==========================================
274
 
275
- @app.get("/psych/questions", response_model=List[schemas.PsychQuestionItem])
276
  def get_psych_questions():
277
  """Mengambil daftar soal tes kepribadian."""
278
  return psych_service.get_all_questions()
279
 
280
- @app.post("/psych/submit", response_model=schemas.PsychResultResponse)
281
  async def submit_psych_test(req: schemas.PsychSubmitRequest):
282
  """Menerima jawaban user, hitung skor, dan minta analisis LLM."""
283
 
 
75
  print(f"👉 Pastikan folder 'model_artifacts' ada di: {base_dir}")
76
 
77
  # --- 2. ENDPOINT REKOMENDASI (ML POWERED) ---
78
+ @app.post("/recommendations", response_model=List[schemas.RecommendationItem], tags=["Recommendation"])
79
  async def generate_recommendations(req: schemas.UserProfile):
80
 
81
  user_data = req.model_dump() if hasattr(req, 'model_dump') else req.dict()
 
88
  # --- 3. ENDPOINT CHAT ROUTER ---
89
  # app/main.py (Bagian process_chat saja)
90
 
91
+ @app.post("/chat/process", response_model=schemas.ChatResponse, tags=["Main Router"])
92
  async def process_chat(req: schemas.ChatRequest):
93
  available_skill_names = []
94
  role_data = None
 
233
  )
234
 
235
 
236
+ @app.post("/exam/submit", response_model=schemas.EvaluationResponse, tags=["Tes Sub Skill"])
237
  async def submit_exam(sub: schemas.AnswerSubmission):
238
  evaluation = await llm_engine.evaluate_answer(
239
  user_answer=sub.user_answer,
 
255
  )
256
 
257
  # --- 5. ENDPOINT PROGRESS ---
258
+ @app.post("/progress/analyze", tags=["Track Progress"])
259
  async def get_progress_analysis(data: schemas.ProgressData):
260
  # Konversi objek Pydantic ke Dictionary biasa
261
  progress_dict = data.dict()
 
272
  # ENDPOINT PSIKOLOGI (JOB ROLE TEST)
273
  # ==========================================
274
 
275
+ @app.get("/psych/questions", response_model=List[schemas.PsychQuestionItem], tags=["Test Job Role"])
276
  def get_psych_questions():
277
  """Mengambil daftar soal tes kepribadian."""
278
  return psych_service.get_all_questions()
279
 
280
+ @app.post("/psych/submit", response_model=schemas.PsychResultResponse, tags=["Test Job Role"])
281
  async def submit_psych_test(req: schemas.PsychSubmitRequest):
282
  """Menerima jawaban user, hitung skor, dan minta analisis LLM."""
283