Compare commits
3 Commits
55ee3b7ba4
...
41b3a250a7
| Author | SHA1 | Date | |
|---|---|---|---|
| 41b3a250a7 | |||
| 96d8621d49 | |||
| b23502ee6a |
@ -1,5 +1,6 @@
|
||||
import io
|
||||
import os
|
||||
import asyncio
|
||||
import traceback
|
||||
|
||||
from asgiref.sync import sync_to_async
|
||||
@ -66,7 +67,7 @@ async def next_vacancy(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
await context.bot.send_message(chat_id=update.effective_chat.id, text=message)
|
||||
return
|
||||
|
||||
vacancy = get_next_vacancy(customer_cv)
|
||||
vacancy = await asyncio.to_thread(get_next_vacancy, customer_cv)
|
||||
if not vacancy:
|
||||
message = "Вакансии закончились, возвращайтесь позже!"
|
||||
await context.bot.send_message(chat_id=update.effective_chat.id, text=message)
|
||||
|
||||
@ -24,7 +24,8 @@ WHERE timestamp >= %(timestamp)s
|
||||
'заниматься', 'формат', 'занятость', 'вилка', 'должност', 'контакт'
|
||||
]) >= 5
|
||||
AND arrayCount(x -> position(lower(message), x) > 0, [
|
||||
'о себе', 'обо мне', 'умею', '#ищу', '#резюме', 'университет', 'колледж'
|
||||
'о себе', 'обо мне', 'умею', '#ищу', '#резюме', 'университет', 'колледж',
|
||||
'не будет опубликовано'
|
||||
]) = 0
|
||||
ORDER BY timestamp ASC
|
||||
"""
|
||||
@ -42,7 +43,7 @@ class Command(BaseCommand):
|
||||
min_salary_rub: int | None
|
||||
max_salary_rub: int | None
|
||||
|
||||
openai_client = ChatOpenAI(model_name="gpt-5-mini", reasoning_effort="minimal", temperature=0, seed=42, top_p=1)
|
||||
openai_client = ChatOpenAI(model_name="gpt-5-mini", temperature=0, seed=42, top_p=1)
|
||||
structured_llm = openai_client.with_structured_output(Structure)
|
||||
|
||||
last_timestamp = timezone.now() - timedelta(days=30)
|
||||
@ -59,6 +60,7 @@ class Command(BaseCommand):
|
||||
Ты — HR-классификатор. Ниже приведён список допустимых профессий.
|
||||
Твоя задача — выбрать наиболее подходящую по смыслу.
|
||||
Качество классификации - самое важное.
|
||||
Если не уверен, то лучше укажи "Другое", ошибки недопустимы.
|
||||
Игнорируй орфографические и стилистические различия.
|
||||
Вакансия:
|
||||
{row[3]}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
from vacancies.main.models import Vacancy
|
||||
from django.db.models import Q
|
||||
|
||||
|
||||
def get_next_vacancy(customer_cv):
|
||||
vacancy = Vacancy.objects.exclude(
|
||||
id__in=customer_cv.customer.recommended_vacancies.values_list("vacancy_id", flat=True),
|
||||
).filter(
|
||||
vacancy = Vacancy.objects.filter(
|
||||
~Q(id__in=customer_cv.customer.recommended_vacancies.values_list("vacancy_id", flat=True)),
|
||||
Q(min_salary_rub__isnull=True) | Q(min_salary_rub__gt=customer_cv.min_salary_rub),
|
||||
job_title__title__in=customer_cv.job_titles.values_list("title", flat=True),
|
||||
min_salary_rub__gt=customer_cv.min_salary_rub,
|
||||
).first()
|
||||
if vacancy:
|
||||
customer_cv.customer.recommended_vacancies.create(vacancy=vacancy)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user