feat: персональные AI модели, оптимизация задач, фильтрация словаря
- Добавлена поддержка персональных AI моделей для каждого пользователя - Оптимизация создания заданий: батч-запрос к AI вместо N запросов - Фильтрация слов по языку изучения (source_lang) в словаре - Удалены неиспользуемые колонки examples и category из vocabulary - Миграции для ai_model_id и удаления колонок 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -178,3 +178,22 @@ class UserService:
|
||||
if user:
|
||||
user.tasks_count = count
|
||||
await session.commit()
|
||||
|
||||
@staticmethod
|
||||
async def update_user_ai_model(session: AsyncSession, user_id: int, model_id: Optional[int]):
|
||||
"""
|
||||
Обновить AI модель пользователя
|
||||
|
||||
Args:
|
||||
session: Сессия базы данных
|
||||
user_id: ID пользователя
|
||||
model_id: ID модели или None для глобальной
|
||||
"""
|
||||
result = await session.execute(
|
||||
select(User).where(User.id == user_id)
|
||||
)
|
||||
user = result.scalar_one_or_none()
|
||||
|
||||
if user:
|
||||
user.ai_model_id = model_id
|
||||
await session.commit()
|
||||
|
||||
Reference in New Issue
Block a user