```py if file != None: # Posting user's query as a message in the thread # file.open() # x = file.read() # print("AAAA", type(x)) message_file = client.files.create( file=file.open("rb"), purpose="assistants" ) # file.close() message = client.beta.threads.messages.create( thread_id=thread.id, role="user", content=user_query, attachments=[ { "file_id": message_file.id, "tools": [{"type": "file_search"},] }, ] )``` this is the full snippet if u have to take a look
`if file is not None` btw