openai / openai-openapi

OpenAPI specification for the OpenAI API
https://platform.openai.com/docs/api-reference/introduction
MIT License
1.3k stars 378 forks source link

add unsupported_file error type for VectorStoreFileObject #300

Open JensWalter opened 3 months ago

JensWalter commented 3 months ago

I tried listing my vector store file and received an error not part of the spec.

Doing the API call manually I saw that the status code returned is not yet included in the openAPI yaml.

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.

vrurg commented 3 months ago

I don't think it worth a new issue only because it's just another enum, so I report it here. Another code I saw and which is not specced yet: "invalid_file".

{
  "id": "...",
  "object": "vector_store.file",
  "usage_bytes": 0,
  "created_at": 1722298943,
  "vector_store_id": "...",
  "status": "failed",
  "last_error": {
    "code": "invalid_file",
    "message": "The file could not be parsed because it is too large."
  },
  "chunking_strategy": {
    "type": "static",
    "static": {
      "max_chunk_size_tokens": 800,
      "chunk_overlap_tokens": 400
    }
  }
}