#Need help restoring assistant to previous save
1 messages · Page 1 of 1 (latest)
Hi @acoustic lotus. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
I'm sorry to hear about your issue. Based on the information provided in the knowledge sources, it seems that there isn't a built-in feature to revert changes to an assistant or restore it to a previous save.
However, there is a way to list all the assistants you have created. Here is a Python code snippet that fetches the newest 100 assistants and prints their ID, instructions, and creation date:
from openai import OpenAI
from datetime import datetime
client = OpenAI()
# Fetch the newest 100 assistants
my_assistants = client.beta.assistants.list(order="desc", limit=100)
# Iterate over list and print the required fields
for assistant in my_assistants.data:
assistant_id = assistant.id
instructions = assistant.instructions or "No instructions provided."
lines = instructions.splitlines()[:6]
instructions_snippet = ('\n'.join(lines)).replace("\n", "¶")
if len(instructions_snippet) > 160:
instructions_snippet = instructions_snippet[:160] + "..."
created = datetime.fromtimestamp(assistant.created_at).strftime('%Y-%m-%d %H:%M:%S')
print(f"ID: {assistant_id}\nInstructions: {instructions_snippet}\n"
f"Created At: {created}\n{'-' * 50}")
This might help you identify the assistant you're looking for. However, it's important to note that this code will not retrieve the original instructions if they have been overwritten.
As for listing all the threads, it seems that OpenAI does not currently provide a feature to list all your threads. However, you could save the thread_id in a database when you create a thread, and then list your threads that way (source (https://community.openai.com/t/856484)).
In the future, it's recommended to back up your prompts and instructions to avoid such issues. You could include the prompts in a database, so recreation wouldn't be a problem (source (https://community.openai.com/t/948826)).
I hope this helps, and let me know if you have any other questions!
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@acoustic lotus kapa.ai is still learning and improving, please let us know how it did by reacting below