Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateFileRequest does not include "vision" purpose #260

Open
phronmophobic opened this issue May 19, 2024 · 1 comment
Open

CreateFileRequest does not include "vision" purpose #260

phronmophobic opened this issue May 19, 2024 · 1 comment

Comments

@phronmophobic
Copy link

Use "assistants" for Assistants and Message files, "vision" for Assistants image file inputs,

The purpose documentation says "vision" is a valid purpose, but the spec does not include it:

enum: ["assistants", "batch", "fine-tune"]

@dewmguy
Copy link

dewmguy commented May 22, 2024

https://platform.openai.com/docs/api-reference/files/create

documentation clearly states

"vision" for Assistants image file inputs

https://platform.openai.com/docs/api-reference/files/object#files/object-purpose

documentation also states vision is an appropriate use for the 'purpose' enum.

i'm under the assumption that my code (snippet below) should be working when using the vision purpose

const isImage = file.name.match(/\.(jpeg|jpg|webp|png)$/i);
const filePurpose = isImage ? 'vision' : 'assistants';
const fileData = await openai.files.create({ file: fileObject, purpose: filePurpose });

but i get this error:

Error: 400 Files with extensions [.png] are not supported for retrieval. See https://platform.openai.com/docs/assistants/tools/file-search/supported-files.

should i be using urls rather than trying to push the file buffer like i would for any other file upload purpose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants