Uniquely naming threads in Assistant api

Hello,

Is there any way of generating the thread in such a way that you are able to chose it’s value?

For example if i want my thread to have a user-specific value (say thread_xxxxxUser123), is that possible? Or what would be a good way to keep track of existing threads for multiple users?

I don’t think there is an option at the moment. Please look at this screenshot

It does not have an option to provide a name. There is a metadata option though. But, I am not sure how we can use that to identify the user-specific thread.

I think this is what you could do:

Every time you create a thread, store the thread name, and the corresponding user name/id in a database like Redis, and call the specific thread for the user when he/she returns.

Thank you for the reply and that great solution!

Another thing, Is there any way to list all current threads for one Assistant?

Hi,

I am glad you found my response useful.

As far as I can tell, there is no way to list all current threads for an assistant. You will have to store that information also on your side. Every time a thread is added to an assistant, you can store that in a database.

1 Like