From 358a423c6b1008b1e9750c944cbb1d183e4e26c9 Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Sat, 1 Jun 2024 00:45:26 +0000 Subject: [PATCH] Added max_tokens. Actually, I should make that an environment variable. Fuck --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index a9ce145..4a4842b 100755 --- a/bot.py +++ b/bot.py @@ -34,7 +34,7 @@ async def on_message(message): async def ask_gpt(ctx, *, question: str): try: # Send the question to GPT-4o using the new OpenAI API - response = await aclient.chat.completions.create(model="gpt-4o", + response = await aclient.chat.completions.create(model="gpt-4o", max_tokens=2000, messages=[ {"role": "system", "content": "You are a helpful assistant. You exist inside a discord server. There is a character limit so please keep responses brief if possible."}, {"role": "user", "content": question}