ChatGPT Plugin Starter TypeScript NextJS

In the world of AI development, there are plenty of Python examples but far fewer in Typescript/Javascript.

This is starter app for building ChatGPT plugins in typescript. It uses the new Next 13 app routes, which are still “beta” so use at your own r…


This content originally appeared on DEV Community and was authored by gannon

In the world of AI development, there are plenty of Python examples but far fewer in Typescript/Javascript.

This is starter app for building ChatGPT plugins in typescript. It uses the new Next 13 app routes, which are still "beta" so use at your own risk! Clone / star / fork the repo here: https://github.com/gannonh/chatgpt-plugin-starter-nextjs

ChatGPT Plugins

ChatGPT Plugins are an alpha feature of ChapGPT and you need to join the waitlist to get access. Once granted access you'll get an email from OpenAI and the plugins interface will be available to you in ChatGPT. While not ideal, you can begin developing plugins (which are simply API routes) without access.

OpenAI plugins connect ChatGPT to third-party applications. These plugins enable ChatGPT to interact with APIs, enhancing ChatGPT's capabilities and allowing it to perform a wide range of actions. Developing ChatGPT plugins involves building an API accompanied by a standardized manifest file and an OpenAPI specification. These define the plugin's functionality, allowing ChatGPT to make calls to you API routes. ChatGPT plugin APIs follow the OpenAPI specification (OpenAPI, aka Swagger, not OpenAI!), which allows ChatGPT to automatically generate a UI for the plugin. This UI is used to configure the plugin and to display the plugin's output. For more information on ChatGPT plugins, see the documentation.

Getting started

Like the OpenAI Python starter, this is a simple ToDo app, meant to jumpstart your own efforts building a nextJS based API. To get started:

1. Clone (or fork) the repo and install dependencies

gh repo clone gannonh/chatgpt-plugin-starter-nextjs

cd chatgpt-plugin-starter-nextjs

npm install

2. Build and run the API

npm run build
npm run start

⚠️ In dev mode (npm run dev) I had issues with memory/state persistence, so I recommend running in production mode

3. Register your plugin for local access/development

  • In ChatGPT select "Plugins ALPHA" from the Model dropdown, and then "plugin store" from the Plugins dropdown.
  • Click "Develop your own plugin" (not install unverified plugin)
  • Enter localhost for the URL (eg, http://localhost:3000)

Usage

Here are some commands you can try

  • What are my todos?
  • Add build a chatgpt plugin to my todos
  • How many open todos do I have?

Deploy with Vercel

Click the button below to deploy on Vercel.
Deploy with Vercel


This content originally appeared on DEV Community and was authored by gannon


Print Share Comment Cite Upload Translate Updates
APA

gannon | Sciencx (2023-04-29T15:13:11+00:00) ChatGPT Plugin Starter TypeScript NextJS. Retrieved from https://www.scien.cx/2023/04/29/chatgpt-plugin-starter-typescript-nextjs/

MLA
" » ChatGPT Plugin Starter TypeScript NextJS." gannon | Sciencx - Saturday April 29, 2023, https://www.scien.cx/2023/04/29/chatgpt-plugin-starter-typescript-nextjs/
HARVARD
gannon | Sciencx Saturday April 29, 2023 » ChatGPT Plugin Starter TypeScript NextJS., viewed ,<https://www.scien.cx/2023/04/29/chatgpt-plugin-starter-typescript-nextjs/>
VANCOUVER
gannon | Sciencx - » ChatGPT Plugin Starter TypeScript NextJS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/04/29/chatgpt-plugin-starter-typescript-nextjs/
CHICAGO
" » ChatGPT Plugin Starter TypeScript NextJS." gannon | Sciencx - Accessed . https://www.scien.cx/2023/04/29/chatgpt-plugin-starter-typescript-nextjs/
IEEE
" » ChatGPT Plugin Starter TypeScript NextJS." gannon | Sciencx [Online]. Available: https://www.scien.cx/2023/04/29/chatgpt-plugin-starter-typescript-nextjs/. [Accessed: ]
rf:citation
» ChatGPT Plugin Starter TypeScript NextJS | gannon | Sciencx | https://www.scien.cx/2023/04/29/chatgpt-plugin-starter-typescript-nextjs/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.