Skip to content

imaurer/pypi-gpt

Repository files navigation

PyPI GPT

This is an open-source demonstration (MIT License) of building actions for Custom GPTs. It is built with FastAPI, SQLModel and Pydantic.

This project is NOT associated with Python Software Foundation or the Python Package Index (PyPI).

The data used was downloaded from the pypi-data/pypi-json-data repository.

Getting Started

Setup Environment

This project was built using Python 3.11 and the Makefile scripts assume a virtual environment can be found under the relative path ./env from the root of the project.

I have a Makefile for the major steps, below is a description of those steps.

Create Environment and Install Dependencies

    $ python3.11 -m venv env
    $ make install

Download, Unzip and Index Database

Downloads data from the pypi-data/pypi-json-data project. Unzips and indexes the file.

    $ make download_db

Test Code

    $ make test
    $ make cov

Run API

You need to run this on a server or service that supports HTTPS. I use ngrok and nginx locally.

  $ export PYPI_GPT_SERVER_HOSTNAME=(YOUR HOST NAME HERE!)
  $ make api

Screenshots

Configure Custom GPT

OpenAPI Spec

Import Actions

Chat Calls Server

OpenAPI Response

Chat Formats Result