Using Assistants API to get information through another API for your own Database

I’ve done something very similar to this! I have a postgreSQL database I wanted to get data from using my agent, so I used an ORM (in my case SQLAlchemy) to connect to it in Python. I created a role in my database that only gave me read access so I wouldn’t mess anything up, and then made a function that takes in a plain text SQL query, executes it, and returns a string with the outputted values. Then all that was left was adding the function to my agent’s toolbelt.