Can't attach a file to a thread within a message

Hey guys, my problem is that I can’t attach files to a message in my code. It worked before when i created the assistant manually in my code. But now I want to use a pre build assistant and attach a file within a message to the Thread of the assistant. Somehow it gives me an error sayin "Can’t open file because its not accessable with the tool “myfiles_browser”, even though i always upload pdfs…

        thread = client.beta.threads.create()
        message = client.beta.threads.messages.create(
        thread_id=thread.id,
        role="user",
        content="",
        file_ids=[file_upload.id]
        )
        run = client.beta.threads.runs.create(
        thread_id=thread.id,
        assistant_id="Assistant_id",
        instructions="",
        tools=[ {"type": "retrieval"}]
        )

Like I said everything worked before when i created the assistant in my code but now it doenst anymore…
Highly apprecciate any kind of help! Thanks

1 Like