Skip to content

Commit eae2cd3

Browse files
committed
Merge v0.77.1
2 parents eaa331d + fbdf03c commit eae2cd3

4 files changed

Lines changed: 333 additions & 91 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,26 @@ If you run into any issues, consult the logs or reach out on the repository's [I
240240
---
241241

242242
# Changelog
243+
244+
- v0.77.1 - OpenAI newer model (5.x series) / tools compatibility update
245+
- Added support for modern OpenAI Chat Completions tool calling via `tools` / `tool_choice` / `tool_calls`.
246+
- Added backward-compatible parsing for both modern `tool_calls` and legacy `function_call` responses.
247+
- Added `build_openai_tools()` to convert the existing legacy ChatKeke `custom_functions` format into OpenAI's modern tools format.
248+
- Added `extract_function_call_or_none()` so function-call detection no longer depends only on the old `message["function_call"]` field.
249+
- Updated payload building so function calling can work with newer model families, including GPT-5.x-style models.
250+
- Restricted `temperature` to GPT-4-family models only, avoiding API errors from newer reasoning-style models that reject sampling parameters.
251+
- Uses `max_completion_tokens` for newer non-GPT-4 models while keeping `max_tokens` for GPT-4-family models.
252+
- Hardened OpenAI response parsing to avoid confusing `KeyError: 'choices'` failures when the API returns an error body.
253+
- Added safer handling for missing or empty `choices` responses.
254+
- Updated function-call follow-up calls so tool results are appended into chat context and the final user-facing answer is generated with `include_functions=False`, reducing accidental recursive tool calls.
255+
- Updated affected function branches:
256+
- `calculate_expression`
257+
- `get_weather`
258+
- `get_duckduckgo_search`
259+
- `get_website_dump`
260+
- `get_stock_price`
261+
- `query_perplexity`
262+
- `manage_reminder`
243263
- v0.7616 - Changed default Perplexity API model to `sonar` as per new model changes in the Perplexity API
244264
- v0.7615 - Parsing improvements
245265
- Improved text formatting & escaping in complex markdown vs. html cases

config/config.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ AskForTokenIfNotFound = True
1515

1616
# Model to use via OpenAI API
1717
# NOTE: SEE ALSO THE NEW AUTO-SWITCHING FEATURE UNDER: [ModelAutoSwitch]
18-
Model = gpt-4o-mini
18+
Model = gpt-5.4-mini
1919

2020
# Model temperature; OpenAI's default is 0.7
2121
# Higher temperature equals more creative (= less factual) output. much over 1.0 not recommended.
@@ -126,11 +126,11 @@ Enabled = True
126126
# The preferred, more capable model to use by default (e.g., gpt-4o, gpt-4.5-preview).
127127
# This model will be used until its daily token limit (PremiumTokenLimit) is reached.
128128
# PremiumModel = gpt-4o
129-
PremiumModel = gpt-4.1
129+
PremiumModel = gpt-5.4-mini
130130

131131
# The cheaper model to switch to when the PremiumTokenLimit is reached (e.g., gpt-4o-mini).
132132
# This model has its own daily token limit (MiniTokenLimit).
133-
FallbackModel = gpt-4o-mini
133+
FallbackModel = gpt-5.4-mini
134134

135135
# Daily token limit for models considered "Premium" (e.g., gpt-4o).
136136
# Set to number of tokens (i.e. 1000000 for 1M; 500000 for 500k etc)

src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# https://github.com/FlyingFathead/TelegramBot-OpenAI-API
77
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88
# version of this program
9-
version_number = "0.7616"
9+
version_number = "0.77.1"
1010

1111
# Add the project root directory to Python's path
1212
import sys

0 commit comments

Comments
 (0)