/
artyuhovs
/
AIFeedBackTrainingBot
Обзор
Документация
Войти
/
artyuhovs
/
AIFeedBackTrainingBot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
app/services/input_context.py
41 строка
1 KB
Codex
Завершить архитектурное оздоровление и исправить итоги
15 июл 2026, 11:05
15 июл 2026, 11:05
c65f9a6
Код
Авторство
О чём код?
from __future__ import annotations import asyncio from app.db.models import MessageRecord from app.db.read_models import SelfAssessmentTaskRecord from app.db.repositories import Repositories class InputContextQuery: """Resolve the next-input context without exposing persistence to Telegram transport.""" def __init__(self, repository: Repositories) -> None: self.repository = repository async def mode(self, user_id: int, *, at: str | None) -> str | None: return await asyncio.to_thread( self.repository.input_intents.input_mode, user_id, at=at, ) async def response_format(self, user_id: int) -> str | None: return await asyncio.to_thread( self.repository.input_intents.current_submission_response_format, user_id, ) async def message(self, record_id: int) -> MessageRecord | None: return await asyncio.to_thread(self.repository.messages.get_message, record_id) async def self_assessment_task( self, assignment_id: int, user_id: int, ) -> SelfAssessmentTaskRecord | None: return await asyncio.to_thread( self.repository.self_assessment.self_assessment_task, assignment_id, user_id, )