https://github.com/vemonet/ontogpt-api
⛏️ An API to extract informations from text using OntoGPT
https://github.com/vemonet/ontogpt-api
gpt-3 linkml ontology
Last synced: about 1 month ago
JSON representation
⛏️ An API to extract informations from text using OntoGPT
- Host: GitHub
- URL: https://github.com/vemonet/ontogpt-api
- Owner: vemonet
- License: mit
- Created: 2023-02-22T08:40:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T15:23:54.000Z (almost 2 years ago)
- Last Synced: 2025-04-13T20:30:08.838Z (6 months ago)
- Topics: gpt-3, linkml, ontology
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Citation: CITATION.cff
Awesome Lists containing this project
README
# ⛏️ OntoGPT API
An API to extract informations from text using [OntoGPT](https://github.com/monarch-initiative/ontogpt).
## 🧑💻 Development setup
To run the API locally for development.
### 📥️ Clone
Clone the repository:
```bash
git clone https://github.com/vemonet/ontogpt-api
cd ontogpt-api
```
### 🐣 Install dependenciesInstall [Hatch](https://hatch.pypa.io), this will automatically handle virtual environments and make sure all dependencies are installed when you run a script in the project:
```bash
pip install --upgrade hatch
```Install the dependencies in a local virtual environment:
```bash
hatch -v env create
```Create a `.env` file with your BioPortal and OpenAI API keys required to run OntoGPT:
```bash
BIOPORTAL_APIKEY=XXX
OPENAI_APIKEY=XXX
```### 🚀 Run the API
On http://localhost:8000
```bash
hatch run dev
```### 🧹 Code formatting
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
```### ♻️ Reset the environment
In case you are facing issues with dependencies not updating properly you can easily reset the virtual environment with:
```bash
hatch env prune
```## 🐳 Deploy in production with docker
Create a `.env` file with your BioPortal and OpenAI API keys:
```bash
BIOPORTAL_APIKEY=XXX
OPENAI_APIKEY=XXX
```Deploy with docker-compose:
```bash
docker-compose up
```> Access on http://localhost:8000