async-openai icon indicating copy to clipboard operation
async-openai copied to clipboard

add unsupported_file error type for vector_store.file

Open JensWalter opened this issue 6 months ago • 2 comments

I tried listing my vector store file and received the following error.

value: JSONDeserialize(Error("unknown variant `unsupported_file`, expected one of `internal_error`,
 `file_not_found`, `parsing_error`, `unhandled_mime_type`", line: 204, column: 34))

Doing the API call manually I saw that the status code returned is not yet supported in async-aponai.

curl https://api.openai.com/v1/vector_stores/vs_Y.../files -H 'OpenAI-Beta: assistants=v2'

the response.

    {
      "id": "file-hAV...",
      "object": "vector_store.file",
      "usage_bytes": 0,
      "created_at": 1722070582,
      "vector_store_id": "vs_....",
      "status": "failed",
      "last_error": {
        "code": "unsupported_file",
        "message": "The file type is not supported."
      },
      "chunking_strategy": {
        "type": "static",
        "static": {
          "max_chunk_size_tokens": 800,
          "chunk_overlap_tokens": 400
        }
      }
    },

So I added the status code to the enum.

JensWalter avatar Jul 28 '24 09:07 JensWalter