export const cleanOpenAIError = (error) => {
    const errorData = {};
    const errorObj = error;
    if (typeof error === 'object' && errorObj.message) {
        if (errorObj.response) {
            const responseObj = errorObj.response;
            errorData.status = responseObj.status;
            errorData.data = responseObj.data;
        }
        errorData.message = errorObj.message;
    }
    if (errorData.message) {
        return errorData;
    }
    return error;
};
