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

LastErrorCode enum is missing 'invalid_file' variant

Open vrurg opened this issue 1 year ago • 2 comments

Here is an error that results in failed deserialization error:

{
  "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
    }
  }
}

vrurg avatar Jul 30 '24 00:07 vrurg

Thanks for the issue, it seems like API has new changes which are not yet documented.

Do you mind reporting this on https://github.com/openai/openai-openapi/pull/300 too?

64bit avatar Jul 30 '24 03:07 64bit

I've done as you suggested. Meanwhile, an interesting fact. I did a tests run to check the fix in #252 and it came up with the following:

failures:

---- vector_store_files::tests::vector_store_file_creation_and_deletion stdout ----
Error: JSONDeserialize(Error("unknown variant `invalid_file`, expected one of `internal_error`, `file_not_found`, `parsing_error`, `unhandled_mime_type`", line: 9, column: 26))


failures:
    vector_store_files::tests::vector_store_file_creation_and_deletion

Though it happened on the first run only.

vrurg avatar Jul 30 '24 23:07 vrurg

Fix is released in v0.24.0

64bit avatar Aug 29 '24 08:08 64bit