Hey dear friends,
I have a problem with using multiple files in the assistants API. One file is very fine, with two I get this error: "I have been provided with two files, but unfortunately, neither of these files is accessible with the myfiles_browser tool. The file IDs are:
file-tbi...file-Cxr...
For further assistance with these files, you would need to provide them in a format compatible with the myfiles_browser tool or request a different type of support that doesn’t require direct file interaction. If you could convert these files into a readable format or re-upload them, I would be able to assist you further."
This is my code:
[…]
files_to_upload = [“CSRD_compressed.pdf”, “XHTMLSustainabilityTemplate.docx”]
file_ids =
# Upload each file and store the returned file IDs
for file_name in files_to_upload:
with open(file_name, "rb") as file_data:
file_response = client.files.create(file=file_data, purpose='assistants')
file_ids.append(file_response['id'])
assistant = client.beta.assistants.create(instructions="""
Kim is ...
""",
model="gpt-4-1106-preview",
tools=[{
"type": "retrieval"
}],
file_ids= file_ids
)
[…]
Do you see any obvious errors or something?
Thanks.
Cheers,
Artur