Assistant API can't access files

hello, everyone.
My script works well in which, I upload a file and have the assistant use it to answer questions. So, what I did was, create an assistant in UI, then copy paste it’s id to a global var names ASSISTANT_ID then I pass it to run. Now, I tried to do the same with file ids but it doesn’t work that way for some reason. the bot keeps saying I have no access to those files. What could be the reason for this? the format? this is my full script:

FILE_ID = ['file1, 'file2']
thread = client.beta.threads.create()

message = client.beta.threads.messages.create(,

run = client.beta.threads.runs.create(,

# Poll the status until it is completed
while run.status != 'completed':
    time.sleep(5)  # Wait for 5 seconds before checking again
    run = client.beta.threads.runs.retrieve(,

print("Run completed. Status:", run.status)

# Fetch the messages
messages = client.beta.threads.messages.list(

# Extracting assistant's message from the list of messages
assistant_messages = [msg.content for msg in if msg.role == 'assistant']

if assistant_messages:
    assistant_content = assistant_messages[0][0].text.value
    print("Assistant's Message Content:")
    print("No assistant message found in the response.")