#Can I attach a file to a conversation with a Custom GPT action?
1 messages · Page 1 of 1 (latest)
Hi @spice girder. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Yes, you can attach a file to a conversation with a Custom GPT action. However, there are some specific requirements and limitations you need to be aware of:
-
The file needs to be converted to a base64 string and formatted in the structure that ChatGPT expects. This can be done using a server-side function, such as an Azure Function in Node.js, as demonstrated in the OpenAI Cookbook example (https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_doc#architecture--example).
-
The file can be used by GPT as if it had been uploaded directly to the conversation. However, the file size and token count are limited. Each file can be up to 512 MB in size and can contain up to 2,000,000 tokens. You can attach up to 20 files to a GPT, and up to 10 files can be uploaded to a given conversation (OpenAI Community (https://community.openai.com/t/846493), OpenAI Help Article (https://help.openai.com/en/articles/8437071-data-analysis-with-chatgpt#h_0ae0bae1b7)).
-
If the file is fetched from a third-party API, it needs to meet specific requirements. If the API is not under your control, you may need to deploy your own proxy API to handle the file fetching and conversion (OpenAI Community (https://community.openai.com/t/848948)).
-
The file can be attached at different levels (Assistant, Thread, or Message level) depending on the use case. If many users will interact with the same Assistant and ask questions, the file should be at the Assistant level. If the file is specific to one user or conversation, it should be at the thread or message level (OpenAI Community (https://community.openai.com/t/630272)).