Giter Club home page Giter Club logo

chatgpt-plugin-template's Introduction

chatGPT-plugin-template

For Gophers!


Here are some motivational screenshots:

Screenshot 2023-03-26 at 20 35 16

Screenshot 2023-03-26 at 20 34 21


What are ChatGPT plugins?

In 2 sentences: It's a way to enable ChatGPT to use your app's API. You share the specs, and it can translate a query from the end user to an API call. The full answer is available here. ATM it's in limited alpha.


Steps for Building a ChatGPT Plugin Based on Your Go Web Server

You need to add at least 2 files from root:

  1. Add and edit the file openapi.yaml
  2. Add and edit the file .well-known/ai-plugin.json (you might need to sudo this) As comments are not allowed in a JSON file, check out ai-plugin_example.md for some more details on structuring this file
  3. As a sanity check, double check the paths from file 1 match the endpoints from path 2, and that you changed all the ngrok URLs to your URLs.
  4. execute: $ go run main.go
  5. Add the plugin via the ChatGPT UI by going to the Plugin Store -> Install An Unverified Plugin, and insert the top website domain

FYI

  • If you are running in localhost, use a tunneling tool like ngrok to expose the files. Change in openapi.yaml and in .well-known/ai-plugin.json. And your main.go can remain on localhost.
  • As long as the plugin is unverified, max 15 people can install the plugin

Debug

Problem: You can't access the .well-known/ai-plugin.json file, it might be a permissions issues.

Solution: Go to the root of the repo (e.g. ~/Projects/chatGPT-plugin-template) and run ls -la. If you see that the permissions for the .well-known folder look different - make it the same.


Problem: You are running on localhost and the file .well-known/ai-plugin.json exists in the right place, but the ChatGPT Plugin UI can't find a manifest.

Solution: Use a tunneling tool like ngrok to expose the files. Change to the ngrok url in openapi.yaml and in .well-known/ai-plugin.json. And your main.go can remain on localhost.


Problem: You have successfully added the plugin but it shows an empty field.

Solution: Get your hands dirty to make the prompt engineering easy: change the descriptions and use more keywords for the different actions, do this in the files: openapi.yaml and .well-known/ai-plugin.json.


Problem: The plugin was added successfully, but returns the error ResponseTooLargeError

Solution: The response is limited at 100k characters. If your response is designed to be smaller, it can be that there's an error in the API and it's just returning the entire website. This is mostly common at private projects where security measurements are not in place.

chatgpt-plugin-template's People

Contributors

pisush 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.