Compare commits

..

No commits in common. "41b3a250a7524f0327fa1887f0f8d7ddd6ec3bde" and "55ee3b7ba43757cd76c93cc6b901aab21a2543a4" have entirely different histories.

3 changed files with 7 additions and 10 deletions

View File

@ -1,6 +1,5 @@
import io import io
import os import os
import asyncio
import traceback import traceback
from asgiref.sync import sync_to_async from asgiref.sync import sync_to_async
@ -67,7 +66,7 @@ async def next_vacancy(update: Update, context: ContextTypes.DEFAULT_TYPE):
await context.bot.send_message(chat_id=update.effective_chat.id, text=message) await context.bot.send_message(chat_id=update.effective_chat.id, text=message)
return return
vacancy = await asyncio.to_thread(get_next_vacancy, customer_cv) vacancy = get_next_vacancy(customer_cv)
if not vacancy: if not vacancy:
message = "Вакансии закончились, возвращайтесь позже!" message = "Вакансии закончились, возвращайтесь позже!"
await context.bot.send_message(chat_id=update.effective_chat.id, text=message) await context.bot.send_message(chat_id=update.effective_chat.id, text=message)

View File

@ -24,8 +24,7 @@ WHERE timestamp >= %(timestamp)s
'заниматься', 'формат', 'занятость', 'вилка', 'должност', 'контакт' 'заниматься', 'формат', 'занятость', 'вилка', 'должност', 'контакт'
]) >= 5 ]) >= 5
AND arrayCount(x -> position(lower(message), x) > 0, [ AND arrayCount(x -> position(lower(message), x) > 0, [
'о себе', 'обо мне', 'умею', '#ищу', '#резюме', 'университет', 'колледж', 'о себе', 'обо мне', 'умею', '#ищу', '#резюме', 'университет', 'колледж'
'не будет опубликовано'
]) = 0 ]) = 0
ORDER BY timestamp ASC ORDER BY timestamp ASC
""" """
@ -43,7 +42,7 @@ class Command(BaseCommand):
min_salary_rub: int | None min_salary_rub: int | None
max_salary_rub: int | None max_salary_rub: int | None
openai_client = ChatOpenAI(model_name="gpt-5-mini", temperature=0, seed=42, top_p=1) openai_client = ChatOpenAI(model_name="gpt-5-mini", reasoning_effort="minimal", temperature=0, seed=42, top_p=1)
structured_llm = openai_client.with_structured_output(Structure) structured_llm = openai_client.with_structured_output(Structure)
last_timestamp = timezone.now() - timedelta(days=30) last_timestamp = timezone.now() - timedelta(days=30)
@ -60,7 +59,6 @@ class Command(BaseCommand):
Ты HR-классификатор. Ниже приведён список допустимых профессий. Ты HR-классификатор. Ниже приведён список допустимых профессий.
Твоя задача выбрать наиболее подходящую по смыслу. Твоя задача выбрать наиболее подходящую по смыслу.
Качество классификации - самое важное. Качество классификации - самое важное.
Если не уверен, то лучше укажи "Другое", ошибки недопустимы.
Игнорируй орфографические и стилистические различия. Игнорируй орфографические и стилистические различия.
Вакансия: Вакансия:
{row[3]} {row[3]}

View File

@ -1,12 +1,12 @@
from vacancies.main.models import Vacancy from vacancies.main.models import Vacancy
from django.db.models import Q
def get_next_vacancy(customer_cv): def get_next_vacancy(customer_cv):
vacancy = Vacancy.objects.filter( vacancy = Vacancy.objects.exclude(
~Q(id__in=customer_cv.customer.recommended_vacancies.values_list("vacancy_id", flat=True)), 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), ).filter(
job_title__title__in=customer_cv.job_titles.values_list("title", flat=True), job_title__title__in=customer_cv.job_titles.values_list("title", flat=True),
min_salary_rub__gt=customer_cv.min_salary_rub,
).first() ).first()
if vacancy: if vacancy:
customer_cv.customer.recommended_vacancies.create(vacancy=vacancy) customer_cv.customer.recommended_vacancies.create(vacancy=vacancy)