Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
n3d1117 committed Apr 22, 2023
1 parent f121db2 commit c83dc8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ALLOWED_TELEGRAM_USER_IDS=USER_ID_1,USER_ID_2
# MAX_TOKENS=1200
# MAX_HISTORY_SIZE=15
# MAX_CONVERSATION_AGE_MINUTES=180
# VOICE_REPLY_WITH_TRANSCRIPT_ONLY=false
# VOICE_REPLY_WITH_TRANSCRIPT_ONLY=true
# VOICE_REPLY_PROMPTS="Hi bot;Hey bot;Hi chat;Hey chat"
# N_CHOICES=1
# TEMPERATURE=1.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Check out the [Budget Manual](https://github.com/n3d1117/chatgpt-telegram-bot/di
| `MAX_HISTORY_SIZE` | Max number of messages to keep in memory, after which the conversation will be summarised to avoid excessive token usage | `15` |
| `MAX_CONVERSATION_AGE_MINUTES` | Maximum number of minutes a conversation should live since the last message, after which the conversation will be reset | `180` |
| `VOICE_REPLY_WITH_TRANSCRIPT_ONLY` | Whether to answer to voice messages with the transcript only or with a ChatGPT response of the transcript | `false` |
| `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 | -
| `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` | - |
| `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` |
| `TEMPERATURE` | Number between 0 and 2. Higher values will make the output more random | `1.0` |
| `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` |
Expand Down
3 changes: 2 additions & 1 deletion bot/telegram_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ async def _execute():
self.usage["guests"].add_transcription_seconds(audio_track.duration_seconds, transcription_price)

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

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

Expand Down

4 comments on commit c83dc8f

@drbuilderpro
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bro, I need some help. How can i talk to u?

@n3d1117
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bro, I need some help. How can i talk to u?

You can open an issue or a new discussion

@drbuilderpro
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please Check. I added my concern in discussion and issue sections now. Iam a Dentist, and i found your Repo very Helpfull and i have one bot. Thanks alot. You are Great. The bot is really Helping in Case Discussions💖

@drbuilderpro
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need ALLOWED_TELEGRAM_GROUP_IDS in Variable

Now Only "ALLOWED_TELEGRAM_USER_IDS" available in varaibles. By adding "ALLOWED_TELEGRAM_GROUP_IDS" need to allow all members of a specific group access bot. When enabled "ALLOWED_TELEGRAM_GROUP_IDS", bot should not work for "ALLOWED_TELEGRAM_USER_IDS" also in other chats. Even if a chat is not added in "ALLOWED_TELEGRAM_GROUP_IDS", if "ADMIN" bot should answer.

Can You Help Please

Please sign in to comment.