Skip to content

Commit 31cb074

Browse files
committed
small fixes
1 parent e36e161 commit 31cb074

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

config.ini

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Model = gpt-3.5-turbo-1106
99
# Higher temperature equals more creative (= less factual) output. much over 1.0 not recommended.
1010
Temperature = 1.0
1111

12-
# Timeout (in seconds to wait for the reply)
12+
# Timeout on OpenAI API requests
13+
# (in seconds to wait for the reply)
1314
Timeout = 30.0
1415

1516
# Maximum number of tokens in context
@@ -38,6 +39,15 @@ IsBotDisabled = False
3839
# Message to send to the user if the bot is disabled.
3940
BotDisabledMsg = "This bot is currently taking a break! Sorry!"
4041

42+
# ~~~
43+
# WIP
44+
# ~~~
45+
# Session timeout in minutes (0 = disable trimming based on time)
46+
# SessionTimeoutMinutes = 1
47+
48+
# Max messages to retain after session timeout (0 = clear entire history)
49+
# MaxRetainedMessages = 0
50+
4151
# ~~~~~~~~~~~
4252
# Local setup
4353
# ~~~~~~~~~~~

main.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,6 @@ class TelegramBot:
5858

5959
def __init__(self):
6060

61-
# Load configuration first
62-
self.load_config()
63-
64-
# Initialize logging
65-
self.initialize_logging()
66-
67-
# Initialize chat logging if enabled
68-
self.initialize_chat_logging()
69-
7061
# Attempt to get bot & API tokens
7162
try:
7263
self.telegram_bot_token = get_bot_token()
@@ -75,6 +66,12 @@ def __init__(self):
7566
self.logger.error(f"Required configuration not found: {e}")
7667
sys.exit(1)
7768

69+
# Load configuration first
70+
self.load_config()
71+
72+
# Initialize logging
73+
self.initialize_logging()
74+
7875
# Initialize chat logging if enabled
7976
self.initialize_chat_logging()
8077

0 commit comments

Comments
 (0)