-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete Assistants #321
Delete Assistants #321
Conversation
Linter failures can be fixed with |
assistant is most likely connected to threads. Those threads in my opinion should be updated to empty assistant when the assistant is removed. |
There are two ways to look at this problem: Which one of this should we go for @mkorpela? |
This was discussed before and the decision was made to enable assigning a new assistant to a thread whose original assistant got deleted. So basically, whenever there is an attempt to open a thread which no longer has an associated assistant, prompt the user to choose a new assistant from existing assistants. |
Do we then imagine "nullifying" the assistant ID for all the threads associated with the assistant? This way it is possible to easily identify all the dangling threads directly. |
Exactly. |
@bakar-io was there any consideration for only allowing assignment of assistants that "support" the existing messages types from a thread? For example, can/should a plain chatbot assistant be assigned to a thread that contains |
@bakar-io ok let me implement that |
@andrewnguonly No. Details were not discussed - only the general approach. |
@andrewnguonly I just tested and your intuition is correct: assigning a thread with tool_calls to chatbot leads to a deserialization error. This error occurs when an attempt is made to continue chatting with this newly moved thread. To keep things simple and straightforward, I propose that when a bot is deleted, all of its threads are also automatically deleted. Here's why I think that's the best approach: Before a bot is deleted, each thread can check their parent bot's type (one of: chatbot, chat_retrieval, agent). But once a bot is deleted, this information is no longer accessible to a thread. The only way at this point would be to iterate through a thread's messages and detect if tool_calls is present. This seems to me a bit of a hack. So, I think that moving threads from bot A to bot B should be done before deleting bot A. We can split this flow into two PRs. This PR can simply focus on deleting bot and deleting all associated threads. The second PR can enable users to attach threads to suitable bots. When a bot is deleted from the frontend, we can require user to confirm deletion and let them know that all associated threads are going to be deleted (and if they want to keep the threads, they should move them first). |
To keep the scope of this PR small, I'm fine with this approach. However, I suggest including a warning or some kind of confirmation before deleting all associated threads as part of this initial change. |
@bakar-io thanks for this! Had to be out for a week for a personal engagement. |
Added the feature to delete assistants