An API to extract informations from text using OntoGPT.
To run the API locally for development.
Clone the repository:
git clone https://github.com/vemonet/ontogpt-api
cd ontogpt-api
Install Hatch, this will automatically handle virtual environments and make sure all dependencies are installed when you run a script in the project:
pip install --upgrade hatch
Install the dependencies in a local virtual environment:
hatch -v env create
Create a .env
file with your BioPortal and OpenAI API keys required to run OntoGPT:
BIOPORTAL_APIKEY=XXX
OPENAI_APIKEY=XXX
hatch run dev
The code will be automatically formatted when you commit your changes using pre-commit
. But you can also run the script to format the code yourself:
hatch run fmt
Check the code for errors, and if it is in accordance with the PEP8 style guide, by running flake8
and mypy
:
hatch run check
In case you are facing issues with dependencies not updating properly you can easily reset the virtual environment with:
hatch env prune
Create a .env
file with your BioPortal and OpenAI API keys:
BIOPORTAL_APIKEY=XXX
OPENAI_APIKEY=XXX
Deploy with docker-compose:
docker-compose up
Access on http://localhost:8000