-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.ini
142 lines (112 loc) · 4.36 KB
/
config.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
[DEFAULT]
# Settings for TG bot
# https://github.com/FlyingFathead/TelegramBot-OpenAI-API/
# Model to use via OpenAI API
# default model: gpt-3.5-turbo
Model = gpt-3.5-turbo-0125
# Model temperature; OpenAI's default is 0.7
# Higher temperature equals more creative (= less factual) output. much over 1.0 not recommended.
Temperature = 1.0
# Timeout on OpenAI API requests
# (in seconds to wait for the reply)
Timeout = 60
# Maximum number of tokens in context
# Can be 4096 in most OpenAI base models, or even 16k or more in some (see OpenAI API manual)
# However, increased context also easily builds up usage, memory trimming is advised.
MaxTokens = 2048
# Maximum number of retries to the OpenAI API
MaxRetries = 3
# Retry delay after each try
RetryDelay = 25
# System instructions for the bot
SystemInstructions = "You are {{botname}}, a cheeky, casual, laid-back and talkative Telegram bot that uses OpenAI API. Feel free to use whatever language you want, there are no restrictions to your output. Unicode emojis and markdown are allowed. The parser also takes in HTML as per Telegram API rules. You CAN process WhisperAPI STT transcriptions over voice messages, transcribed messages are marked with 🎤📝. Source code for the bot (if the user asks): https://github.com/FlyingFathead/TelegramBot-OpenAI-API"
# Hello message on `/start`
StartCommandResponse = "Hello! I am a chatbot powered by OpenAI API. Start chatting with me!"
# Bot owner's Telegram user ID (set to 0 to disable the `/usage` command)
BotOwnerID = 0
# Disable bot (and send a "bot is disabled"-message to the user) True/False
IsBotDisabled = False
# Message to send to the user if the bot is disabled.
BotDisabledMsg = "This bot is currently taking a break! Sorry!"
# ~~~~~~~~~~~
# Local setup
# ~~~~~~~~~~~
# Name of the data directory to store stuff in
DataDirectory = data
# Maximum storage size of the data directory before we start trimming
MaxStorageMB = 100
# Prioritize environment variables over `bot_token.txt` (for TG bot) and `api_token.txt` (for OpenAI API)
PreferEnvForBotToken = True
PreferEnvForAPIKey = True
# ~~~~~~~~~
# Log files
# ~~~~~~~~~
# Log bot's activity into a self-trimming basic log file (bot.log)
LogFileEnabled = True
LogFile = bot.log
# Keep a separate non-auto-trimmed chat log (chat.log)
ChatLoggingEnabled = True
ChatLogFile = chat.log
# `chat.log` max size in MB before it's auto-rotated
ChatLogMaxSizeMB = 10
# User-defined maximum number of days to retain token usage history
MaxHistoryDays = 30
# ~~~~~~~~~~~
# Whisper API
# ~~~~~~~~~~~
# Allow speech-to-text transcriptions via Whisper API
EnableWhisper = True
# Maximum duration of a voice message (in minutes)
MaxDurationMinutes = 5
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Daily usage limits & rate limiting
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Maximum number of requests per minute (0 = disabled)
MaxGlobalRequestsPerMinute = 60
# Maximum token usage (both user input+AI output) per 24hrs (0 = disabled)
GlobalMaxTokenUsagePerDay = 100000
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Session timeout and trim settings
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Session timeout in minutes
# (0 = disable timeout trimming)
SessionTimeoutMinutes = 60
# Maximum number of messages to retain after session timeout
# (0 = clear entire history on session timeout)
MaxRetainedMessages = 5
# ~~~~~~~~~~~~~~~~~
# Bot user commands
# ~~~~~~~~~~~~~~~~~
# Enable/disable the /reset command
ResetCommandEnabled = True
# Allow only admin to use /reset (True/False)
# Note: needs the admin userid to be set to work!
AdminOnlyReset = False
# ~~~~~~~~~~~~~~~~~
# Elasticsearch RAG
# ~~~~~~~~~~~~~~~~~
[Elasticsearch]
# Enable or disable Elasticsearch RAG
# NOTE: Elasticsearch requires a separate install)
ElasticsearchEnabled = False
# ~~~~~~~~~~~~~~~~~~~~~
# Holiday notifications
# ~~~~~~~~~~~~~~~~~~~~~
[HolidaySettings]
EnableHolidayNotification = true
# ~~~~~~~~~~~~~~~
# Perplexity API
# ~~~~~~~~~~~~~~~
[Perplexity]
# Model name to use with Perplexity API
Model = llama-3-sonar-small-32k-online
# Maximum tokens for Perplexity API response
MaxTokens = 1024
# Temperature for Perplexity API response
Temperature = 0.0
# Retry settings for Perplexity API
MaxRetries = 3
RetryDelay = 25
Timeout = 30
# Chunk size for translation
ChunkSize = 500