Spaces:
Sleeping
Sleeping
Download app/models/schemas.py from AnishDev/coderound-task-backend: direct link, hf CLI and curl.
- Browser
- Download file 3.31 kB
-
https://huggingface.co/spaces/AnishDev/coderound-task-backend/resolve/main/app/models/schemas.py
- Command line
-
hf download hf://spaces/AnishDev/coderound-task-backend/app/models/schemas.py
-
curl -L -o schemas.py https://huggingface.co/spaces/AnishDev/coderound-task-backend/resolve/main/app/models/schemas.py
3.31 kB
| from pydantic import BaseModel, Field | |
| from typing import Optional, Any | |
| # βββ JD Schemas ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| class JDUploadResponse(BaseModel): | |
| jd_id: str | |
| title: str | |
| engineer_type: Optional[str] | |
| min_years: float | |
| required_skills_count: int | |
| preferred_skills_count: int | |
| uploaded_at: str | |
| class JDListItem(BaseModel): | |
| jd_id: str | |
| title: str | |
| engineer_type: Optional[str] | |
| min_years: float | |
| required_skills_count: int | |
| uploaded_at: str | |
| class JDDetailResponse(JDListItem): | |
| required_skills: list[dict] | |
| preferred_skills: list[dict] | |
| responsibilities: list[str] | |
| # βββ Candidate Schemas ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| class CandidateBatchResponse(BaseModel): | |
| batch_id: str | |
| total_count: int | |
| engineer_type_distribution: dict[str, int] | |
| uploaded_at: str | |
| class BatchListItem(BaseModel): | |
| batch_id: str | |
| total_count: int | |
| engineer_type_distribution: dict[str, int] | |
| uploaded_at: str | |
| # βββ Match Schemas ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| class MatchTriggerRequest(BaseModel): | |
| batch_id: str | |
| top_n: int = Field(default=10, ge=1, le=50) | |
| class MatchTriggerResponse(BaseModel): | |
| match_id: str | |
| status: str # "processing" | "completed" | |
| total_candidates: int | |
| filtered_candidates: int | |
| results: Optional[list["CandidateMatchResponse"]] = None | |
| class SkillMatchInfo(BaseModel): | |
| skill: str | |
| candidate_level: int | |
| required_level: int | |
| score: float | |
| status: str | |
| class ScoreBreakdownResponse(BaseModel): | |
| skill_score: float | |
| semantic_score: float | |
| position_score: float | |
| special_score: float | |
| final_score: float | |
| penalties: list[dict[str, Any]] | |
| class CandidateMatchResponse(BaseModel): | |
| rank: int | |
| candidate_id: str | |
| name: str | |
| current_position: str | |
| years_of_experience: float | |
| engineer_type: str | |
| final_score: float | |
| tier: str | |
| score_breakdown: ScoreBreakdownResponse | |
| matched_skills: list[SkillMatchInfo] | |
| below_level_skills: list[SkillMatchInfo] | |
| missing_skills: list[str] | |
| flags: list[str] | |
| notice_period: Optional[str] | |
| most_recent_company: Optional[str] | |
| class MatchResultsResponse(BaseModel): | |
| jd_id: str | |
| jd_title: str | |
| batch_id: str | |
| top_n: int | |
| total_matched: int | |
| candidates: list[CandidateMatchResponse] | |
| class CandidateDetailResponse(CandidateMatchResponse): | |
| explanation: Optional[str] = None | |
| explanation_cached: bool = False | |
| class StatusResponse(BaseModel): | |
| match_id: str | |
| status: str # "pending" | "processing" | "completed" | "failed" | |
| progress: Optional[float] = None | |
| message: Optional[str] = None | |
| completed_at: Optional[str] = None | |
| class ErrorResponse(BaseModel): | |
| detail: str | |
| code: Optional[str] = None | |
| # Update forward refs | |
| MatchTriggerResponse.model_rebuild() | |