Added max_tokens. Actually, I should make that an environment variable. Fuck
This commit is contained in:
parent
18b0e79fb9
commit
358a423c6b
2
bot.py
2
bot.py
@ -34,7 +34,7 @@ async def on_message(message):
|
|||||||
async def ask_gpt(ctx, *, question: str):
|
async def ask_gpt(ctx, *, question: str):
|
||||||
try:
|
try:
|
||||||
# Send the question to GPT-4o using the new OpenAI API
|
# 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=[
|
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": "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}
|
{"role": "user", "content": question}
|
||||||
|
Loading…
Reference in New Issue
Block a user