Why assistant did not have any response or reponsing unable to access

I am trying to use the retrieval function. Here is my code.

from openai import OpenAI

client = OpenAI()

file = client.files.create(
    file=open('./test.txt', 'rb'),
    purpose='assistants'
)

assistant = client.beta.assistants.create(
    name="Airwallex document Q&A",
    instructions="You are a helpful chatbot to answer the question from customers according to given knowledge.",
    tools=[{"type": "retrieval"}],
    model="gpt-4-1106-preview",
    file_ids=[file.id],

)

thread = client.beta.threads.create()

message = client.beta.threads.messages.create(
    thread_id=thread.id,
    role="user",
    content="I would like to know something about online payment.",
    file_ids=[file.id]
)

run = client.beta.threads.runs.create(
  thread_id=thread.id,
  assistant_id=assistant.id)
messages = client.beta.threads.messages.list(thread_id=thread.id, limit=20)
print(messages.data[0].content[0].text.value)

Sometimes it will response

''

or

"I apologize, but it seems there was an issue with the file you uploaded, and I'm unable to access it with the tools provided to me. To provide a summary in one sentence, I need to access the content of the file. Could you please try re-uploading the file? If you have specific questions about online payment, feel free to ask, and I’ll do my best to answer them based on the information available to me."

I would like to know, is this problem from my prompt or other?