You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to push some files and later use them on vectorstore assistants.
However, I can't add the files to VS because it rejects the names as not supported.
"{\n \"message\": \"Files with extensions [none] are not supported for retrieval. See https://platform.openai.com/docs/assistants/tools/file-search/supported-files\",\n \"type\": \"invalid_request_error\",\n \"param\": \"file_ids\",\n \"code\": \"unsupported_file\"\n }"
Checking the files created with this code.
I noticed that all of them are named 'anonymous_file'
content, err := os.ReadFile(config.FilePath + filename) // the file is inside the local directory if err != nil { fmt.Println("Err") } file, err := client.Files.New(context.TODO(), openai.FileNewParams{ File: openai.F(io.Reader(bytes.NewBuffer([]byte(content)))), Purpose: openai.F(openai.FilePurposeAssistants), })
Is that expected behavior?
I'm missing something?
The text was updated successfully, but these errors were encountered:
In case it's helpful for anyone, I wanted to share a full solution here.
@jacobzim-stl FWIW, I think the biggest footgun is that it's not quite clear how to solve it based on the error message or the typings, so I think an updated example would do wonders here. I think the API design itself could be improved, but it definitely works as-is. It could just use better guardrails since (IMO) you shouldn't be able to upload an anonymous file to the assistants API since it can't really be used.
#150 specifically had the information that fixed this for me (use the openai.FileParam struct).
Here's a full example (also available at this gist):
I'm trying to push some files and later use them on vectorstore assistants.
However, I can't add the files to VS because it rejects the names as not supported.
"{\n \"message\": \"Files with extensions [none] are not supported for retrieval. See https://platform.openai.com/docs/assistants/tools/file-search/supported-files\",\n \"type\": \"invalid_request_error\",\n \"param\": \"file_ids\",\n \"code\": \"unsupported_file\"\n }"
Checking the files created with this code.
I noticed that all of them are named 'anonymous_file'
content, err := os.ReadFile(config.FilePath + filename) // the file is inside the local directory if err != nil { fmt.Println("Err") } file, err := client.Files.New(context.TODO(), openai.FileNewParams{ File: openai.F(io.Reader(bytes.NewBuffer([]byte(content)))), Purpose: openai.F(openai.FilePurposeAssistants), })
Is that expected behavior?
I'm missing something?
The text was updated successfully, but these errors were encountered: