How vilsonkhchoian/promting_project_iad works
Purpose
Essay Checker Bot is a Telegram workflow for evaluating English exam essays against HSE-style criteria. A student submits an essay task and essay text; the system asks GigaChat for a 0–10 score plus feedback. Core runtime logic is in bot.py; provider and prompt settings are centralized in config.py.
Runtime Entry Point
bot.py is the executable application boundary. It receives Telegram updates, manages the multi-message checking interaction, invokes the LLM, and returns the generated assessment. /start begins a new evaluation and /cancel clears an in-progress one.
Paths: bot.py, config.py
Conversation-State Pipeline
The bot implements a sequential collection flow:
1. User starts a session.
2. Bot receives and retains the essay assignment.
3. Bot receives the essay body, including long responses.
4. The combined task/essay payload is submitted for evaluation.
5. The resulting score and comments are delivered back through Telegram.
This stateful chat boundary separates untrusted user input from the model request construction.
Paths: bot.py
Prompted Evaluation Layer
Evaluation behavior is driven by a prompt template and model-generation parameters: endpoint URLs, model selection, temperature, maximum tokens, and credentials. The intended rubric covers task response, cohesion, vocabulary/register, and grammar. Prompt design includes an injection-resistant variant and was empirically compared before being used in the bot.
Paths: config.py, Промпты.pdf, bot.py
External-Service Boundaries
Telegram is the inbound/outbound messaging transport; its bot token is configured outside application logic. GigaChat is the production inference provider, accessed through configured API endpoints and API credentials. The application depends on network availability and provider response formatting when producing a user-visible grade.
Paths: bot.py, config.py, requirements.txt
Offline Model and Prompt Evaluation
The notebook is the experimentation and validation environment rather than the serving path. It runs essay checks against GigaChat and OpenRouter-accessed models, retries poor responses, and calculates evaluation metrics. Its findings are persisted as spreadsheets: detailed per-essay/model/prompt results and aggregate ranking metrics such as MAE, RMSE, Spearman, and QWK.
Paths: essay_prompt_project.ipynb, model_scores.xlsx, metrics_summary.xlsx
Supporting Project Artifacts
Project documentation records the chosen criteria, candidate models, prompt variants, experimentation methodology, metrics, and prompt-injection considerations. These artifacts define the quality-governance context for future changes to the prompt or underlying model, but are not application runtime dependencies.
Paths: Проект ПЗАД.pdf, Промпты.pdf, README.md
Main entry points: essay_prompt_project.ipynb Experiment notebook · bot.py Bot application · config.py Provider and prompt settings · model_scores.xlsx Detailed model scores
Components 16
Telegram Runtime
Production essay-checking workflow.
- Student
- Bot application · Manages commands, state, LLM calls, and replies.
bot.py - Conversation state · Retains assignment then essay body before evaluation.
bot.py - Evaluation request · Combines the task and essay as model input.
bot.py - Provider and prompt settings · Defines rubric prompt, model parameters, endpoints, and credentials.
config.py - Score and feedback · 0–10 grade with rubric-based comments.
bot.py - Runtime dependencies · Declares Telegram and provider client dependencies.
requirements.txt
Offline Evaluation
Prompt and model validation workflow.
- Experiment notebook · Compares prompts and models, retries responses, and calculates metrics.
essay_prompt_project.ipynb - Detailed model scores · Per-essay, model, and prompt outcomes.
model_scores.xlsx - Ranking metrics · MAE, RMSE, Spearman, and QWK summaries.
metrics_summary.xlsx
External Services
- Telegram · Inbound and outbound chat transport.
- GigaChat · Production scoring and feedback provider.
- OpenRouter models · Alternative models evaluated offline.
Quality Artifacts
- Prompt variants · Includes injection-resistant prompt designs.
Промпты.pdf - Project methodology · Records criteria, models, methodology, and governance.
Проект ПЗАД.pdf - Project README
README.md
Connections 20
- Student → Telegram: sends task and essay
- Telegram → Bot application: delivers updates
- Bot application → Conversation state: collects sequential inputs
- Conversation state → Evaluation request: task + essay
- Provider and prompt settings → Evaluation request: supplies rubric prompt
- Evaluation request → GigaChat: submits evaluation
- Provider and prompt settings → GigaChat: endpoint, model, credentials
- GigaChat → Score and feedback: returns generated grade
- Score and feedback → Bot application: formats response
- Bot application → Telegram: sends assessment
- Telegram → Student: delivers feedback
- Runtime dependencies → Bot application: provides runtime libraries
- Experiment notebook → GigaChat: evaluates prompts
- Experiment notebook → OpenRouter models: compares models
- Experiment notebook → Detailed model scores: writes detailed results
- Experiment notebook → Ranking metrics: writes aggregate metrics
- Prompt variants → Experiment notebook: candidate prompts
- Detailed model scores → Ranking metrics: aggregated into rankings
- Project methodology → Experiment notebook: defines evaluation methodology
- Project README → Project methodology: project context