This commit is contained in:
Showdown76 2023-04-12 17:27:24 +00:00
commit 5d1debc0b0
2 changed files with 2 additions and 2 deletions

View File

@ -14,3 +14,5 @@ MAX_TOKEN_PER_REQUEST = [Maximum tokens per request] (recommended: 1800-2000)
TOKEN = [Your Discord bot's token] TOKEN = [Your Discord bot's token]
OPENAI_API_KEY = [OpenAI Token -- can be found at https://platform.openai.com/account/api-keys] OPENAI_API_KEY = [OpenAI Token -- can be found at https://platform.openai.com/account/api-keys]
``` ```
#### The `tokens.db` database is blank and contains no data.

View File

@ -51,7 +51,6 @@ def num_tokens_from_string(string: str) -> int:
@app.event @app.event
async def on_message(message: discord.Message): async def on_message(message: discord.Message):
print('msg received')
if not isinstance(message.channel, discord.DMChannel): return if not isinstance(message.channel, discord.DMChannel): return
if message.author.id == app.user.id: return if message.author.id == app.user.id: return
try: try:
@ -86,7 +85,6 @@ async def on_message(message: discord.Message):
for arg in arguments.keys(): bprompt = bprompt.replace(f'|{arg}|', arguments[arg]) for arg in arguments.keys(): bprompt = bprompt.replace(f'|{arg}|', arguments[arg])
previous_tokens = 200+len(bprompt)+message_token_usage previous_tokens = 200+len(bprompt)+message_token_usage
print(bprompt)
# (message_id, user_id, content, token, role, timestamp) # (message_id, user_id, content, token, role, timestamp)
# order by timestamp (most recent to least recent) # order by timestamp (most recent to least recent)
usable_messages = [] usable_messages = []