What are the life spans of inactive assistant and thread?

Well, I did have about 200 assistants “hanging around”. I let them go with code like the following:

from openai import OpenAI
client = OpenAI()

AssistantsList = client.beta.assistants.list()

import json
assistantsInJSON = json.loads(AssistantsList.model_dump_json())

assistantdata = assistantsInJSON[“data”]
for numitems in assistantdata:
print(“This asst id is: \n”, numitems[“id”])
DelResponse = client.beta.assistants.delete(numitems[“id”])
print(DelResponse)

exit()

1 Like