There will be some external Python libraries that will be used. These should be added to this file so that the deployer can easily add to the system Python (or venv, if-used, but typically we don't):
We then want a wrapper class to provide an Eden-like API. I imagine an S3AI() class in modules/s3/s3ai.py (AI being the superset encompassing ML). This holds the generic parts - I like the Wolfram Language approach that the programmer should be able to access high-level functions which are then acted upon with sensible defaults....those default /can/ be over-ridden for specific cases. So the S3AI API would be very similar to this (over time, of course...don't expect the full feature set instantly!):
& the class instance would be exposed to the user via a current.ai object...like we have for current.db/s3db, current.gis, current.msg, current.xml, etc Within S3AI, it then decides which Python libraries it needs to do it's job & which functions from those to call & how to format the options, etc Then, much like for Messaging, we can have a common API which can have different underlying providers switched in/out without affecting the Eden programmer. If there is some common storage requirement then we can either just add tables internally in the class (as is done by s3aaa and s3import), or via an s3db file (as is done by s3gis, s3msg & s3sync).
Application-specific calls to this core would live within either core models (modules/s3db/*.py) or templates depending on how generic it was. This could include the use of Custom Methods. It is conceivable that these /could/ include ones direct in S3AI, however I don't currently see what they would be.