Should BaseResponse Error.Code be string or int? Compatibility with LiteLLM #615
-
Hi.
I created question for LiteLLM: But also I want to ask you, what is the right type for this code: string or int? Is there any official API for it? Maybe you can support both variants? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
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"
}
} |
Beta Was this translation helpful? Give feedback.
-
Hi, @kayhantolga |
Beta Was this translation helpful? Give feedback.
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.