I can upload the files directly to my assistant via the playground, but when I upload the file through Make, I can see the file available under "Files", but my assistant can't access it
some screenshots of my file being uploaded via Make, the file existing in Files. When talking to the assistant in the playground, it can readily answer answer questions about the 3 .docx files, but does not see the PDF that was uploaded via Make
#Files uploaded through API show up under 'Files' yet assistants cannot access files them
1 messages · Page 1 of 1 (latest)
Hi @limpid plover. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the information provided in the extracts, it seems like the issue might be related to how the file is being attached to the assistant or the type of file being uploaded.
When you upload a file via the OpenAI API, you need to ensure that the file is attached to the assistant or the specific message for it to be accessible. If a file is attached at the Assistant-level, it is accessible by all Runs with this Assistant. If a file is attached at the Message-level, it is only accessible within the specific Thread the Message is attached to [source (https://platform.openai.com/docs/assistants/tools)].
Here is an example of how to attach a file to an assistant:
# Upload a file with an "assistants" purpose
file = client.files.create(
file=open("knowledge.pdf", "rb"),
purpose='assistants'
)
# Add the file to the assistant
assistant = client.beta.assistants.create(
instructions="You are a customer support chatbot. Use your knowledge base to best respond to customer queries.",
model="gpt-4-1106-preview",
tools=[{"type": "retrieval"}],
file_ids=[file.id]
)
Also, note that the maximum file size is 512 MB and no more than 2,000,000 tokens. Retrieval supports a variety of file formats including .pdf, .md, .docx and many more [source (https://platform.openai.com/docs/assistants/tools)].
If you are still facing issues, it might be a bug with the Python library. There was a similar issue reported where the API failed to create the file correctly when using files.retrieve_content [source (https://github.com/openai/openai-python/issues/819)].
If none of these solutions work, I would recommend reaching out to OpenAI support for further assistance.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@limpid plover kapa.ai is still learning and improving, please let us know how it did by reacting below