You can now do this thanks to Microsoft's Semantic Kernel SDK which integrates Large Language Models (LLMs)with conventional programming languages like C# and Python. The Java binding has recently been released too.
Videos of the lectures taught in Fall 2023 at the University of Tennessee are now available as a YouTube playlist. They provide a complete overview of the concepts of GeoSpatial science using Google Earth Engine, PostgresSQL GIS , DuckDB, Python and SQL. https://www.i-programmer.info/news/145-mapping-a-gis/16772-spatial-data-management-for-gis-and-data-scientists.html