#context API help

1 messages · Page 1 of 1 (latest)

cosmic trail
#

Hello everyone, I have been wanting to solve the problem for a long time, I need to find a command in the aiogram library that does the same thing as on the ChatGPT website, namely “New Chat”, that is, so that after this command the bot forgets the context of previous messages. my code:

update(neiro1, "user", message.text)
await message.reply("please second 🤔")
await bot.send_chat_action(message.chat.id, "typing")
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=neiro1
)
gpt = (response['choices'][0]['message']['content'])
await bot.edit_message_text(chat_id=message.chat.id, message_id=message.message_id + 1, text=f"{gpt}")

drowsy galleon
#

in messages=neiro1, maybe you can add a command to give a new message variable?