Integrating Astropy and PyVO with OpenAI's API

Hello, I’m new to the forum and i’ve come to seek help or guidance.
I’m working on a project trying to make data discovery easier for any person trying to use Virtual Observatory data. The idea is to make a natural language based search on the virtual observatories using OpenAi’s API, Astropy and it’s affiliated package, PyVO. For this we would use OpenAI to process the questions or petitions anyone would have and then have it give us some code that we could programatically execute. We have made it work up untill executing the code, because as of today, the API works with GPT-3.5, that has knowledge up untill september 2021, which means the code given by the API is based on Astropy 4.3 and PyVO 1.1. We thought of downgrading the packages, but there’s a problem with Astropy, as we can’t install 4.3 because theres an error:

"ImportError: cannot import name 'soft_unicode' from 'markupsafe'"

If anyone that reads this has any advice on installing Astropy 4.3 or a different aproach to our project’s goal (like developing a different AI), please, we would welcome your input a lot. Thanks in advace!

First, have you tried using the current version of astropy? The API changes are minimal and probably not important in the few functions that you need (i.e. we typically add functionality, but rarely remove any. If there are extra keywords etc. that you don’t use, it won’t harm).

Second, how you install astropy, e.g. do you use conda or pip? Can you post the entire output from your installation?
It sounds as if the version of markupsafe in your installation might be old, but I can’t say for sure from just that one line. You might want to try pip install --upgrade markupsafe and see if that helps, but that’s just a guess - I can’t tell for sure without knowing which packages are in your environment and how they are installed.