Skip to content

Commit c83dc8f

Browse files
committed
minor improvements
1 parent f121db2 commit c83dc8f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ALLOWED_TELEGRAM_USER_IDS=USER_ID_1,USER_ID_2
2828
# MAX_TOKENS=1200
2929
# MAX_HISTORY_SIZE=15
3030
# MAX_CONVERSATION_AGE_MINUTES=180
31-
# VOICE_REPLY_WITH_TRANSCRIPT_ONLY=false
31+
# VOICE_REPLY_WITH_TRANSCRIPT_ONLY=true
3232
# VOICE_REPLY_PROMPTS="Hi bot;Hey bot;Hi chat;Hey chat"
3333
# N_CHOICES=1
3434
# TEMPERATURE=1.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Check out the [Budget Manual](https://github.com/n3d1117/chatgpt-telegram-bot/di
8282
| `MAX_HISTORY_SIZE` | Max number of messages to keep in memory, after which the conversation will be summarised to avoid excessive token usage | `15` |
8383
| `MAX_CONVERSATION_AGE_MINUTES` | Maximum number of minutes a conversation should live since the last message, after which the conversation will be reset | `180` |
8484
| `VOICE_REPLY_WITH_TRANSCRIPT_ONLY` | Whether to answer to voice messages with the transcript only or with a ChatGPT response of the transcript | `false` |
85-
| `VOICE_REPLY_PROMPTS` | A semicolon separated list of phrases (i.e. `Hi bot;Hello chat`). If the transcript starts with any of them, it will be treated as a prompt | -
85+
| `VOICE_REPLY_PROMPTS` | A semicolon separated list of phrases (i.e. `Hi bot;Hello chat`). If the transcript starts with any of them, it will be treated as a prompt even if `VOICE_REPLY_WITH_TRANSCRIPT_ONLY` is set to `true` | - |
8686
| `N_CHOICES` | Number of answers to generate for each input message. **Note**: setting this to a number higher than 1 will not work properly if `STREAM` is enabled | `1` |
8787
| `TEMPERATURE` | Number between 0 and 2. Higher values will make the output more random | `1.0` |
8888
| `PRESENCE_PENALTY` | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far | `0.0` |

bot/telegram_bot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ async def _execute():
322322
self.usage["guests"].add_transcription_seconds(audio_track.duration_seconds, transcription_price)
323323

324324
# check if transcript starts with any of the prefixes
325-
response_to_transcription = any(transcript.startswith(prefix) if prefix else False for prefix in self.config['voice_reply_prompts'])
325+
response_to_transcription = any(transcript.lower().startswith(prefix.lower()) if prefix else False
326+
for prefix in self.config['voice_reply_prompts'])
326327

327328
if self.config['voice_reply_transcript'] and not response_to_transcription:
328329

0 commit comments

Comments
 (0)