Skip to content

Commit

Permalink
refactor: config properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Mar 31, 2023
1 parent 4234702 commit a10cfa0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config = yaml.safe_load(f)

# Bot version.
version = 76
version = 83

# Telegram Bot API token.
telegram_token = config["telegram_token"]
Expand All @@ -23,7 +23,7 @@
openai_api_key = config["openai_api_key"]

# OpenAI model name. One of the following:
# gpt-3.5-turbo, gpt-4
# gpt-3.5-turbo | gpt-4
openai_model = config.get("openai_model", "gpt-3.5-turbo")

# The maximum number of previous messages
Expand All @@ -33,5 +33,5 @@
# Where to store the chat context file.
persistence_path = config["persistence_path"]

# Shortcuts
# Custom AI commands (additional prompts)
shortcuts = config.get("shortcuts", {})
19 changes: 18 additions & 1 deletion config.example.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
# see config.py for details
# Bot configuration parameters.

# Telegram Bot API token.
telegram_token: ""

# The list of Telegram usernames allowed to chat with the bot.
# If empty, the bot will be available to anyone.
telegram_usernames: []

# The list of Telegram group ids, whose members are allowed to chat with the bot.
# If empty, the bot will only be available to `telegram_usernames`.
telegram_chat_ids: []

# OpenAI API key.
openai_api_key: ""

# OpenAI model name. One of the following:
# gpt-3.5-turbo | gpt-4
openai_model: "gpt-3.5-turbo"

# The maximum number of previous messages
# the bot will remember when talking to a user.
max_history_depth: 3

# Where to store the chat context file.
persistence_path: "./data/persistence.pkl"

# Custom AI commands (additional prompts)
shortcuts:
bugfix: "Examine the following code. Rewrite it if necessary to fix bugs and various problems. Explain the changes you've made."

Expand Down

0 comments on commit a10cfa0

Please sign in to comment.