#is it possible to add files to chat.completions.create api?
1 messages · Page 1 of 1 (latest)
Hi @tawdry owl. 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 appears that the chat.completions.create API does not directly support file uploads. However, it does support the inclusion of images in the chat messages you pass to the model. This is done by managing the messages (including images) yourself and passing them each time you make a request to the API.
For images, it is suggested to pass them via URLs instead of base64 encoding, especially for long running conversations. The latency of the model can also be improved by downsizing your images ahead of time to be less than the maximum size they are expected to be. For low res mode, a 512px x 512px image is expected. For high res mode, the short side of the image should be less than 768px and the long side should be less than 2,000px.
After an image has been processed by the model, it is deleted from OpenAI servers and not retained. OpenAI does not use data uploaded via the OpenAI API to train their models.
Here is an example of how to use the chat.completions.create API:
const chatCompletion = await openai.chat.completions.create({...})
Please note that the response structure should be accessed like this:
console.log(chatCompletion.choices[0].message);
For more detailed information, please refer to the OpenAI API documentation (https://platform.openai.com/docs/api-reference) and the OpenAI Vision Guide (https://platform.openai.com/docs/guides/vision).
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@tawdry owl kapa.ai is still learning and improving, please let us know how it did by reacting below
@naive rose is there a maximum amount of assistants that i can create?
Let me check the knowledge base for you. One moment! :books:
Based on the information provided in the extracts, there is no explicit mention of a maximum limit on the number of Assistants that can be created. However, there are limits on the number of files that can be attached to an Assistant and the total size of these files. Specifically, you can attach a maximum of 20 files per Assistant, and they can be at most 512 MB each. The size of all the files uploaded by your organization should not exceed 100 GB. If you need to increase this storage limit, you can request an increase using OpenAI's help center (https://help.openai.com/en/).
Please note that each file can only contain 2,000,000 tokens. Assistant or Message creation will fail if any attached files exceed the token limit.