Skip to content

Should BaseResponse Error.Code be string or int? Compatibility with LiteLLM #615

Answered by kayhantolga
repko-artem asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, OpenAI error codes are strings, which is why the SDK expects a string error code. Here is a sample error response from the OpenAI API.

{
  "error": {
    "message": "The model `sdsad` does not exist or you do not have access to it.",
    "type": "invalid_request_error",
    "param": null,
    "code": "model_not_found"
  }
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by repko-artem
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants