178 Commits
Author SHA1 Message Date
Father BotandGitHub 3631d6534f fix: ignore unmentioned media in group chats; bump python-dotenv (#518)
- unsupport_message_handle now checks is_bot_mentioned, so the bot stops
  replying "I don't know how to read files or videos" to videos/documents
  it wasn't mentioned in within group chats (#454). Private chats are
  unaffected (is_bot_mentioned returns True there).
- Bump python-dotenv 1.0.1 -> 1.2.2 to resolve a Dependabot symlink-following
  advisory in set_key.
- Bump version to 1.3.1 and document in CHANGELOG.
2026-06-14 13:45:46 +03:00
Father Bot 2435e7332b docs: make README intro vendor-neutral (OpenAI + Anthropic)
Drop the chat.openai.com framing in favor of a neutral hook that credits
both OpenAI and Anthropic models.
2026-06-14 13:28:27 +03:00
Father BotandGitHub 20a2deb985 docs: revamp README with badges, model/command/mode tables (#517)
Restructure the README in the style of a modern project landing page:
centered header with shield badges, emoji feature list, a models table
(provider, vision, scores, pricing), a chat-modes grid, quick-start steps,
config and command tables, project structure, and changelog highlights.

De-emphasize legacy GPT-4o models in the prose (kept in the model catalog)
and lead with GPT-5.5 and Claude.
2026-06-14 13:26:14 +03:00
Father Bot 8676be8b01 Document OpenRouter and Anthropic models in README 2026-06-14 13:09:57 +03:00
Father Bot a7984073b1 Remove unused is_content_acceptable helper
The moderation helper had no callers anywhere in the codebase. Drop
the dead function.
2026-06-05 12:30:00 +03:00
Father Bot 9503791697 Document 1.3.0 in CHANGELOG
Record removal of legacy gpt-3.5-turbo/gpt-4, the token-table
simplification, README refresh and the /balance KeyError fix.
2026-06-04 14:47:09 +03:00
Father Bot ce2049e4f1 Bump version to 1.3.0 2026-06-01 11:30:18 +03:00
Father Bot 9c0250a2a8 Refresh README: drop legacy GPT-4 mentions
Update the title to GPT-5.5 & Claude and remove the stale 'GPT-4 and
GPT-4 Turbo support' feature line now that those models are gone.
2026-05-29 19:05:14 +03:00
Father Bot 068f996473 Simplify token-count overhead table
The per-model if/elif chain only ever set tokens_per_message=3 for
supported models (and 4 for the now-removed gpt-3.5 family). Collapse
it to a single assignment since every current chat model shares the
same overhead.
2026-05-26 10:15:43 +03:00
Father Bot 5d8f98427e Skip unconfigured models in /balance
Existing users may have token usage recorded against models that have
since been removed from models.yml. Skip any model key not present in
the config when building the balance breakdown so /balance no longer
raises a KeyError for them.
2026-05-23 16:41:20 +03:00
Father Bot b0ca129e75 Remove legacy gpt-3.5-turbo and gpt-4 models
Drop the remaining old models from the menu and config. The lineup is
now gpt-4o-mini (default), gpt-5.5, gpt-4o and the Claude models.
2026-05-20 12:09:55 +03:00
Father Bot 131ba9daab Reflect gpt-image-1 in the 1.2.0 changelog
The release switched image generation to gpt-image-1; update the
changelog entry to match the final state.
2026-05-17 18:48:02 +03:00
Father Bot 6676d0b938 Document gpt-image-1 in README
Update the feature list and News entry to reference gpt-image-1
instead of DALL·E 3.
2026-05-14 09:27:38 +03:00
Father Bot 6eead18619 Update example config comments for gpt-image-1
gpt-image-1 supports multiple images per request and the sizes
1024x1024, 1536x1024, 1024x1536 and auto. Update the comments
accordingly.
2026-05-11 13:21:07 +03:00
Father Bot 0dba82f04f Replace dalle-3 with gpt-image-1 in models.yml
Swap the image model entry to gpt-image-1 ($0.042 per 1024x1024
medium-quality image) so /balance reflects the new model.
2026-05-08 20:33:39 +03:00
Father Bot 3b3fab9e06 Send gpt-image-1 images as bytes and update balance
generate_images now returns raw image bytes, so wrap each in BytesIO
for reply_photo instead of passing a URL. Reference the gpt-image-1
price entry in /balance and relabel it 'GPT Image'.
2026-05-05 11:36:29 +03:00
Father Bot 52857fedde Generate images with gpt-image-1
Replace DALL-E 3 with OpenAI's gpt-image-1 model. gpt-image-1 returns
base64-encoded images instead of URLs, so decode each result to raw
bytes and return the list of images.
2026-05-02 17:14:51 +03:00
Father Bot 625210a924 Document 1.2.0 in CHANGELOG
Record DALL-E 3 image generation, updated gpt-4o pricing, removal of
deprecated models and the new CI workflow.
2026-04-29 10:52:46 +03:00
Father Bot 712898cfeb Bump version to 1.2.0 2026-04-26 15:17:33 +03:00
Father Bot 91c9f51f47 Add minimal CI workflow
Add a GitHub Actions workflow that installs requirements on Python
3.12 and byte-compiles the bot package on every push to main and on
pull requests, catching dependency-resolution and syntax errors early.
2026-04-23 12:40:09 +03:00
Father Bot e09e0017b4 Update README for DALL-E 3 and model cleanup
Reflect DALL·E 3 image generation, generalized vision support and the
removal of deprecated models in the feature list and News section.
2026-04-20 18:05:52 +03:00
Father Bot b7f8224606 Update bot to DALL-E 3 for balance and image accounting
Reference the dalle-3 price entry and label balance details as
DALL·E 3, and count actually returned images (len(image_urls))
instead of the configured request count, since DALL-E 3 always
returns a single image.
2026-04-17 14:23:18 +03:00
Father Bot 169406c377 Replace dalle-2 with dall-e-3 pricing in models.yml
Update the image model entry to dalle-3 at $0.04 per 1024x1024 image
so /balance reflects DALL-E 3 costs.
2026-04-14 09:50:40 +03:00
Father Bot f7459df1ad Default image size to 1024x1024 for DALL-E 3
512x512 is not a valid DALL-E 3 size. Default to 1024x1024 and update
the example config to list the supported DALL-E 3 sizes and note the
one-image-per-request limit.
2026-04-11 19:31:07 +03:00
Father Bot 09ebbbf996 Switch image generation to DALL-E 3
Use the dall-e-3 model in generate_images and default to 1024x1024.
dall-e-3 only supports n=1, so request a single image per call.
2026-04-08 11:08:52 +03:00
Father Bot 04174251b5 Update gpt-4o pricing to current rates
gpt-4o was priced at its launch rate (0.005/0.015). OpenAI later cut
it to $2.50 / $10 per 1M tokens; update to 0.0025/0.01 so /balance
reflects current cost.
2026-04-05 16:42:21 +03:00
Father Bot c828549d7a Remove deprecated models from the menu
Drop gpt-3.5-turbo-16k, gpt-4-1106-preview and gpt-4-vision-preview
from available_text_models and their info blocks. All three are
deprecated/retired by OpenAI; gpt-4o and gpt-4o-mini cover their use
cases (including vision).
2026-04-02 10:14:03 +03:00
Father Bot 755f0a7da5 Fix News section: date the 1.1.0 entries and order chronologically v1.6 2026-03-31 17:00:40 +03:00
Father Bot 06c6e0f653 Note config-driven vision support in CHANGELOG 2026-03-29 13:25:18 +03:00
Father Bot 33ec9c3ead Route image messages by the config vision flag
bot.py decided vision handling from hardcoded gpt-4o/gpt-4-vision
checks. Use the models.yml 'vision' flag instead: any vision-capable
model (incl. gpt-5.5 and Claude) now handles images directly, and a
photo sent to a non-vision model still falls back to gpt-4o. The
rejection message in the vision handler is updated to match.
2026-03-28 18:05:52 +03:00
Father Bot 16441877b8 Gate vision in openai_utils by the config vision flag
send_vision_message and send_vision_message_stream now accept any
model flagged vision: true in models.yml instead of a hardcoded
gpt-4o/gpt-4-vision set, so Claude and gpt-5.5 can process images.
2026-03-27 09:50:27 +03:00
Father Bot e97a0819c1 Flag vision-capable models in models.yml
Add 'vision: true' to models that can read images: gpt-4o,
gpt-4o-mini, gpt-4-vision-preview, gpt-5.5 and the Claude models.
This lets the bot decide vision support from config instead of
hardcoded model names.
2026-03-25 16:20:33 +03:00
Father Bot 8b36c42694 Document OpenRouter, Claude and GPT-5.5 in README
Add a feature bullet and News entry covering OpenRouter provider
support and the new Claude and GPT-5.5 models.
2026-03-24 11:40:09 +03:00
Father Bot 10daaf47c5 Document 1.1.0 in CHANGELOG
Record OpenRouter provider support, Claude models, gpt-5.5, the
config-driven model dispatch, token-counting fallback and the
settings button layout fix.
2026-03-22 14:15:46 +03:00
Father Bot f7ab294690 Bump version to 1.1.0 2026-03-20 10:30:11 +03:00
Father Bot f239b53086 Lay out settings model buttons in rows of two
The settings menu put every model button in a single row. Telegram
rejects rows with more than 8 inline buttons, which would break
/settings now that the model list is longer. Chunk the buttons into
rows of two.
2026-03-19 15:52:08 +03:00
Father Bot 2ace648aa9 Add Anthropic Claude models via OpenRouter
Add Claude Opus 4.8, Claude Sonnet and Claude Haiku as selectable
chat models, routed through OpenRouter (provider: openrouter). Slugs
and pricing taken from the OpenRouter model list. Requires
openrouter_api_key to be set.
2026-03-15 10:28:36 +03:00
Father Bot dbe426775f Add OpenAI gpt-5.5 model (via OpenRouter)
Add OpenAI's latest flagship gpt-5.5 as a selectable model, routed
through OpenRouter (provider: openrouter, slug openai/gpt-5.5).
Pricing taken from the OpenRouter model list.
2026-03-09 17:14:53 +03:00
Father Bot 8b42181274 Add OpenRouter provider support
Introduce an optional OpenRouter client (OpenAI-compatible) alongside
the OpenAI one. Models can declare 'provider: openrouter' in
models.yml; ChatGPT now selects the matching client per model via
_get_client_for_model and routes chat completions through it. This
unlocks non-OpenAI models (e.g. Claude) through a single SDK.

Adds openrouter_api_key / openrouter_api_base config options.
2026-03-03 12:40:21 +03:00
Father Bot 6af26cc9bc Dispatch chat models by config type, not hardcoded lists
Replace the hardcoded model-name sets in __init__, send_message and
send_message_stream with checks against config/models.yml: the assert
now accepts any model defined in models['info'], and the chat path is
taken for any model whose type is 'chat_completion'. Adding a new
chat model is now a models.yml-only change. Vision handling is left
on its explicit model set for now.
2026-02-28 18:47:09 +03:00
Father Bot ee9dae189f Make token counting robust for non-OpenAI models
tiktoken.encoding_for_model and the per-model token table only know
OpenAI models, so any other model (Claude or anything routed via
OpenRouter) raised. Fall back to the o200k_base encoding and a
default tokens_per_message for unknown models so streaming token
estimates work for every chat model.
2026-02-27 14:22:36 +03:00
Father Bot a6f44166a0 Update README for the modernized release
Note that gpt-4o-mini is the default model and add a News entry for
the openai 1.x SDK migration, the new default and the Python 3.12
image, linking to CHANGELOG.md.
2026-02-26 17:58:31 +03:00
Father Bot c82e4e79d0 Add CHANGELOG for the 1.0.0 release
Document the openai 1.x migration, gpt-4o/gpt-4o-mini support and new
default, Python 3.12 upgrade, dependency bumps, Docker improvements
and the text-davinci-003 removal.
2026-02-22 15:13:02 +03:00
Father Bot 6954e4e9a6 Add VERSION file (1.0.0)
Introduce an explicit version marker for the modernized release.
2026-02-18 20:36:49 +03:00
Father Bot e37eb4a248 Drop text-davinci-003 code paths from openai_utils
Remove the legacy completion handling now that the model is gone:
- drop text-davinci-003 from the __init__ assert
- remove the legacy completions.create branches in send_message and
  send_message_stream
- delete the now-unused _generate_prompt and _count_tokens_from_prompt
  helpers

All remaining paths use the chat completions API.
2026-02-14 12:05:18 +03:00
Father Bot 6b90a74567 Remove text-davinci-003 from models config
OpenAI shut down the legacy text-davinci-003 completions model in
early 2024, so it can no longer be used. Drop it from the available
models list and remove its info block.
2026-02-11 18:42:55 +03:00
Father Bot a32a06ab17 Bump python-dotenv to 1.0.1
Move from the 0.21 series to the stable 1.0.x line.
2026-02-08 09:17:26 +03:00
Father Bot e88059e35b Bump pymongo to 4.6.3
Update the MongoDB driver for bug fixes and Python 3.12 compatibility.
2026-02-05 13:54:40 +03:00
Father Bot 638fcf6d7b Bump PyYAML to 6.0.2
PyYAML 6.0 fails to build against Cython 3 on modern toolchains
(including Python 3.12). 6.0.1+ fixes this; pin 6.0.2.
2026-02-02 19:31:07 +03:00
Father Bot 92b824bc7c Bump python-telegram-bot to 20.8
Move to the latest 20.x release for bug fixes while staying within
the v20 major to avoid the breaking changes introduced in v21.
2026-01-30 10:08:52 +03:00