Link files created by assistant (assistants_output) to thread id

I want to know in which thread the assistant has created the files. What is the best way to do it? The storage contains the files of all threads.

Thank You!