Code Monkey home page Code Monkey logo

gpt-actions-python-vercel-boilerplate's Introduction

ChatGPT Plugin - Python FastAPI, Vercel Boilerplate

This repository contains a boilerplate for creating a ChatGPT Plugin API using FastAPI.

If you find this repository useful, please consider giving it a star! ๐ŸŒŸ

Prerequisites

Before you begin, ensure you know how to work with the following:

Developing Locally

  1. Clone this repository using the below git commands or you can clone the git template directly from github.
git clone https://github.com/JohnVersus/gpt-actions-python-vercel-boilerplate.git your_project_name

cd your_project_name
  1. Create a venv and install the required dependencies:
python3 -m venv venv

source venv/bin/activate

pip install -r requirements.txt
  1. Add the required env variables in .env file.

  2. Start the FastAPI server:

python3 main.py

You should now be able to visit http://localhost:8000 to see your API in action.

Files required to be updated to make your own plugin

  1. api/app.py holds the APP API routes. Modify them to build your own application.

  2. Once you have build the API of your plugin start the localhost server with python3 main.py command.

  3. Visit http://localhost:8000/openapi.json to view the openAPI json generated by FastAPI.

Testing the Plugin API Locally

  1. Navigate to http://localhost:8000/docs to access the interactive Swagger UI documentation. Here you can explore the available endpoints and test them out.

Deploying with Vercel

This boilerplate is designed to be deployed with Vercel. Please follow Vercel's deployment documentation for details.

Installing the Plugin on ChatGPT

  1. Deploy the API using Vercel or a platform of your choice.
  2. Make sure to fill the required env variables
  3. Go to ChatGPT > Create new GPT.
  4. Use the openAPI json url of your deployed server in the GPT action and import the API specs. For example: https://chatgpt-plugin-python-vercel-boilerplate.vercel.app/openapi.json is the url for the Bookstore template plugin.
  5. Fill the bearer API key field in actions if required and start testing.

Once the API is working as expected you can publish your GPT

Working Demo

Bookstore GPT URL: https://chat.openai.com/g/g-zDbUeWbMJ-bookstore

image

GPTs built using this repository

image

gpt-actions-python-vercel-boilerplate's People

Contributors

johnversus avatar himario avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.