async def gpt_3_5_turbo(interaction: discord.Interaction, message: str):
response = openai.ChatCompletion.create(
engine="gpt-3.5-turbo",
messages = [ # Change the prompt parameter to the messages parameter
{'role': 'user', 'content': "hello there"}
],
temperature=0.9,
max_tokens=150,
top_p=1,
frequency_penalty=0,
presence_penalty=0.6,
stop=["\n", " Human:", " AI:"]
)
response_text = response['choices'][0]['message']['content']
await interaction.followup.send(response_text, ephemeral=True)
#Command 'chatgpt3_5_turbo' raised an exception: InvalidRequestError: Invalid URL (POST /v1/engines/g
2 messages · Page 1 of 1 (latest)
Well first off, engine has long since been deprecated. You should be using model="gpt-3.5-turbo." I also suggest...cleaning your code up a bit. Your command name is not really specific or friendly and your messages field doesn't make a whole lot of sense. But these alone wouldn't cause the error, so change the engine to model.