You've already forked RekomenciBackend
fix add resume
This commit is contained in:
@@ -22,7 +22,7 @@ class DefaultResumePredictionGenerator(ResumePredictionGenerator):
|
||||
key_skills=resume.key_skills,
|
||||
suituble_vacancies=[
|
||||
SuitableVacancyDs(
|
||||
vacancy_id=suituble_vacancy.vacancy.id,
|
||||
vacancy_id=str(suituble_vacancy.vacancy.id),
|
||||
from_salary=suituble_vacancy.vacancy.from_salary,
|
||||
to_salary=suituble_vacancy.vacancy.to_salary,
|
||||
key_skills=suituble_vacancy.vacancy.key_skills,
|
||||
|
||||
@@ -29,7 +29,7 @@ class MlApiGateway:
|
||||
self._client = client
|
||||
|
||||
async def generate_embedding(self, text: str) -> list[float]:
|
||||
response = await self._client.post("/get_embedding", json={"text": text})
|
||||
response = await self._client.post("/get_embedding", json={"text": text}, timeout=100)
|
||||
return cast(list[float], response.json()["embedding"])
|
||||
|
||||
async def generate_resume_prediction(
|
||||
@@ -39,9 +39,9 @@ class MlApiGateway:
|
||||
suituble_vacancies: Sequence[SuitableVacancyDs],
|
||||
) -> GenerateResumePredictionResponse:
|
||||
response = await self._client.post(
|
||||
"/predict_salary",
|
||||
"/predict",
|
||||
json={
|
||||
"resume_id": resume_id,
|
||||
"resume_id": str(resume_id),
|
||||
"key_skills": key_skills,
|
||||
"vacancies": [
|
||||
{
|
||||
@@ -53,6 +53,7 @@ class MlApiGateway:
|
||||
} for suituble_vacancy in suituble_vacancies
|
||||
],
|
||||
},
|
||||
timeout=100,
|
||||
)
|
||||
|
||||
response_json = response.json()
|
||||
|
||||
@@ -40,9 +40,9 @@ class VacancyInputModel(BaseModel):
|
||||
class PredictSalaryRequestModel(BaseModel):
|
||||
resume_id: ResumeId = Field(description="Resume ID", examples=["01234567-89ab-cdef-0123-456789abcdef"])
|
||||
key_skills: list[str] = Field(
|
||||
min_length=1, description="List of key skills from resume", examples=[["Python", "FastAPI", "PostgreSQL"]]
|
||||
description="List of key skills from resume", examples=[["Python", "FastAPI", "PostgreSQL"]]
|
||||
)
|
||||
vacancies: list[VacancyInputModel] = Field(min_length=1, description="List of relevant vacancies", examples=[[]])
|
||||
vacancies: list[VacancyInputModel] = Field(description="List of relevant vacancies", examples=[[]])
|
||||
|
||||
model_config = {
|
||||
"json_schema_extra": {
|
||||
|
||||
Reference in New Issue
Block a user