178 Commits
Author SHA1 Message Date
Father Bot c48d452612 Remove obsolete version key from docker-compose
The top-level 'version' field is deprecated in Compose v2 and only
produces a warning. Drop it.
2026-01-27 16:45:33 +03:00
Father Bot 9bd3f60d59 Upgrade Docker base image to Python 3.12
python:3.8-slim is EOL (security support ended Oct 2024). Move to
python:3.12-slim and drop the pinned setuptools==59.5.0, which
predates 3.12 support; use the current setuptools instead.
2026-01-24 11:20:14 +03:00
Father Bot 8624e97dd2 Default ChatGPT() model arg to gpt-4o-mini
Keep the ChatGPT class fallback model in sync with the new project
default. Callers always pass an explicit model, so this only affects
the no-argument fallback.
2026-01-22 13:48:09 +03:00
Father Bot ea3af7d3aa Reset to gpt-4o-mini (not gpt-3.5-turbo) on /new
new_dialog_handle pins the model on every /new. Point it at the new
default gpt-4o-mini so starting a new dialog no longer drops users
back onto the outdated gpt-3.5-turbo.
2026-01-14 17:22:41 +03:00
Father Bot bdad62174d Default new users to gpt-4o-mini instead of gpt-3.5-turbo
The default model is taken from available_text_models[0] (used by
Database.add_new_user and the registration fallback). Move
gpt-4o-mini to the front so new users start on it; gpt-3.5-turbo is
outdated, while gpt-4o-mini is cheaper, smarter and supports vision.
This also makes it the first option in the /settings menu.
2026-01-06 11:30:18 +03:00
Father Bot 41a13ee5c9 Drop dead price keys from config.example.yml
chatgpt_price_per_1000_tokens, gpt_price_per_1000_tokens and
whisper_price_per_1_min are not read by config.py; pricing is defined
per model in config/models.yml. Remove them from the example to avoid
implying they have any effect.
2025-12-28 19:40:33 +03:00
Father Bot 4365a9b635 Narrow bare excepts to Exception in bot handlers
Replace the two bare 'except:' clauses (is_bot_mentioned and the
error handler fallback) with 'except Exception:' so they no longer
swallow KeyboardInterrupt, SystemExit or asyncio.CancelledError,
which must propagate for clean shutdown and task cancellation.
2025-12-26 13:15:05 +03:00
Father Bot fe126441d7 Expand .dockerignore to trim build context and secrets
Exclude .git, Python bytecode caches, .DS_Store and the local
config.yml/config.env from the Docker build context so they are not
sent to the daemon or baked into the image.
2025-12-24 16:29:42 +03:00
Father Bot 1bc081d115 Live-mount config dir in docker-compose
Mount ./config into the bot container so config.yml / models.yml /
chat_modes.yml changes take effect with a simple restart instead of
a full image rebuild. Addresses #124.
2025-12-22 11:48:17 +03:00
Father Bot 8d9897d580 Set PYTHONUNBUFFERED=1 for immediate log output
Without unbuffered output the bot's stdout/stderr can sit in a
buffer, so 'docker logs' shows nothing until the buffer flushes.
Set PYTHONUNBUFFERED=1 so log lines appear in real time.
2025-12-21 21:03:50 +03:00
Father Bot a79d1cfbf3 Use pip --no-cache-dir to shrink the Docker image
Disable pip's download cache during the image build so the wheel
cache is not baked into the final layers, reducing image size.
Addresses #186.
2025-12-19 15:12:09 +03:00
Father Bot fc0cac03ab Use openai.BadRequestError in image generation handler
Follow-up to the openai 1.x migration: the legacy
openai.error.InvalidRequestError no longer exists in the 1.x SDK.
Catch openai.BadRequestError when DALL-E rejects a prompt.
2025-12-18 09:37:31 +03:00
Father Bot d48276616a Migrate openai_utils to the openai 1.x SDK
Replace the deprecated module-level openai 0.28 API with the new
AsyncOpenAI client:
- instantiate AsyncOpenAI(api_key, base_url) instead of setting
  openai.api_key / openai.api_base globals
- ChatCompletion.acreate -> client.chat.completions.create
- Completion.acreate(engine=...) -> client.completions.create(model=...)
- Audio.atranscribe -> client.audio.transcriptions.create
- Image.acreate -> client.images.generate
- Moderation.acreate -> client.moderations.create (use .flagged)
- attribute access for message/delta content (.content instead of
  dict access) and guard empty streaming choices
- rename request_timeout option to timeout
- catch openai.BadRequestError instead of openai.error.InvalidRequestError

Bump openai to >=1.40.0,<2.0.0. Requires testing against the API.
2025-12-16 18:54:48 +03:00
Father Bot b4528a2328 Fix date typo in README changelog (Apt -> Apr) 2025-12-15 10:26:14 +03:00
Father Bot cb4f55850a Fix typo in gpt-4-vision description (capabilties -> capabilities) 2025-12-13 17:41:55 +03:00
Father Bot c8ffae21ad Bump tiktoken to >=0.7.0 for gpt-4o token counting
gpt-4o and gpt-4o-mini use the o200k_base encoding, which tiktoken
only ships from 0.7.0 onwards. With the previous >=0.3.0 pin
tiktoken.encoding_for_model("gpt-4o") raises, breaking token
counting in streaming mode for those models.
2025-12-11 12:08:26 +03:00
Father Bot 95a475f5a0 Document GPT-4o and GPT-4o mini support in README
Add GPT-4o / GPT-4o mini to the feature list and News section so the
docs reflect the models now available in /settings.
2025-12-10 20:33:39 +03:00
Father Bot 91f6880f23 Stop tracking .DS_Store
Remove the committed macOS .DS_Store file from the index and add it
to .gitignore so it does not get re-committed.
2025-12-08 14:50:12 +03:00
Father Bot 7123bd14a1 Remove leftover debug logging in message handler
logger.error(current_model) fired on every incoming message and
spammed the error log with the model name; the accompanying
'# What is this? ^^^' note was dead. Drop both; the vision
auto-switch logic is unchanged.
2025-12-07 09:21:57 +03:00
Father Bot 43aa46a872 Add gpt-4o-mini model support
Wire gpt-4o-mini through the bot: register it in models.yml
(available list + pricing/scores entry) and add it to the model
sets in openai_utils (chat, streaming, vision and token counting).
gpt-4o-mini is cheaper and smarter than gpt-3.5-turbo and supports
images, so it is a good default-grade option. Addresses #474.
2025-12-05 19:05:44 +03:00
Father Bot 148b3b8268 Normalize model score labels to capitalized form
gpt-4-1106-preview, gpt-4-vision-preview and gpt-4o used lowercase
score keys (smart/fast/cheap) while the rest used capitalized ones.
These keys are shown verbatim as labels in /settings, so normalize
them for consistent display.
2025-12-04 11:32:08 +03:00
Father Bot 7416a7edd6 Fix gpt-4o scores: it is faster and cheaper than gpt-4
gpt-4o was scored fast:2 cheap:2 (same as plain gpt-4), which is
misleading. Bump to fast:4 cheap:4 to reflect its actual profile.
2025-12-02 16:47:21 +03:00
Father Bot 3aab56a21a Fix incorrect gpt-4o pricing in models.yml
gpt-4o was priced at gpt-4 rates (0.03/0.06). Correct to actual
0.005/0.015 per 1k tokens so the /balance report is accurate.
2025-12-01 10:14:03 +03:00
Father BotandGitHub ba58564d29 Update README.md 2025-06-26 18:12:37 +03:00
OlegGolessandGitHub 2079908ce6 Merge pull request #469 from pyranota/add-gpt-4o
Add support for GPT-4o
2024-06-13 19:11:40 +02:00
Father BotandGitHub 4066ab9a44 Update README.md 2024-06-13 19:28:55 +03:00
pyranota c017c32800 Fix defaulting 2024-05-23 23:27:27 +02:00
pyranota fff2839327 Fix not showing GPT-4o in settings 2024-05-23 18:49:59 +02:00
pyranota 752f38b348 Add support for GPT-4o 2024-05-23 17:45:28 +02:00
OlegGolessandGitHub 7b5fa9a3c3 Merge pull request #453 from father-bot/fix-context
fix bug in context
2024-04-16 14:56:57 +02:00
OlegGoless 6540b28437 fix bug in context 2024-04-16 14:56:04 +02:00
OlegGolessandGitHub 00c5f66be5 Merge pull request #448 from father-bot/fix-image
delete required text caption with image
2024-04-04 10:29:18 +02:00
OlegGoless 5e4552e4df delete required text caption with image 2024-04-04 10:22:53 +02:00
OlegGolessandGitHub 57ee703f07 Merge pull request #444 from father-bot/fix-prints-model
fix
2024-04-02 17:23:37 +02:00
OlegGoless e8a1a1fb2e fix 2024-04-02 17:22:58 +02:00
Father BotandGitHub c26829e9e3 Update README.md 2024-04-02 16:13:17 +03:00
OlegGolessandGitHub d0eb9ee015 Merge pull request #442 from father-bot/vision
Vision
v1.5
2024-04-02 14:52:59 +02:00
OlegGoless 2aa76490fd vision 2024-04-02 14:44:15 +02:00
OlegGoless 3b8b0b2a52 vision 2024-04-02 14:43:04 +02:00
iglvandGitHub 299fb5724b Update README.md 2024-02-23 18:57:01 +03:00
iglvandGitHub 0084ad01ab Delete static/donate directory 2024-01-31 09:24:16 +03:00
iglvandGitHub 0f58815b8d Update README.md 2024-01-31 09:23:30 +03:00
Karim IskakovandGitHub b8621214dd Update README.md 2023-12-08 11:12:20 +03:00
Karim Iskakov 61b8dbd0ce Add GPT-4 Turbo 2023-11-15 17:45:57 +03:00
Karim IskakovandGitHub 977ffb5e32 Fix openai version 2023-11-07 03:29:32 +03:00
Daniil OkhlopkovandGitHub ce0c34825f Store Voice temp files in memory and don't convert them 2023-11-02 16:52:35 +03:00
Karim Iskakov bab5938241 Merge branch 'main' of github.com:karfly/chatgpt_telegram_bot 2023-09-18 11:04:52 +03:00
Karim Iskakov 3d281de0c2 ♥️ Update top donations 2023-09-18 11:04:23 +03:00
Karim IskakovandGitHub d495f7dbbe Update README.md 2023-09-14 12:14:17 +03:00
Dichi Al FaridiandGitHub acd4cab782 Make the DALLe image size configurable (#365) 2023-09-13 13:17:21 +03:00