diff --git a/prompts/plugins/ethscan.md b/prompts/plugins/ethscan.md deleted file mode 100644 index 89d342a5b..000000000 --- a/prompts/plugins/ethscan.md +++ /dev/null @@ -1,55 +0,0 @@ -A ChatGPT plugin that requires a restful api with CORS, a documentation of the API in the OpenAPI yaml format, and a -JSON plugin manifest file that will define relevant metadata for the plugin. - -# Notes on building Plugins - -## API -The API we will be building should wrap the etherscan API endpoints. Etherscan will need an API KEY, for now just create a `.env` file and I will put the key there afterwards - -Use python to write the API - - -## Plugin Manifest -* Every plugin requires a ai-plugin.json file, which needs to be hosted on the API’s domain. For example, a company called example.com would make the plugin JSON file accessible via an https://example.com domain since that is where their API is hosted. When you install the plugin via the ChatGPT UI, on the backend we look for a file located at /.well-known/ai-plugin.json. The /.well-known folder is required and must exist on your domain in order for ChatGPT to connect with your plugin. If there is no file found, the plugin cannot be installed. For local development, you can use HTTP but if you are pointing to a remote server, HTTPS is required. - -The minimal definition of the required ai-plugin.json file will look like the following: -``` -{ - "schema_version": "v1", - "name_for_human": "ethscan user", - "name_for_model": "ethscanner", - "description_for_human": "plugin that makes requests from etherscan", - "description_for_model": "plugin that makes requests from etherscan", - "auth": { - "type": "none" - }, - "api": { - "type": "openapi", - "url": "http://localhost:3333/openapi.yaml", - "is_user_authenticated": false - }, - "logo_url": "http://localhost:3333/logo.png", - "contact_email": "support@example.com", - "legal_info_url": "http://www.example.com/legal" -} -``` -## OpenAPI Definition -* The next step is to build the OpenAPI specification to document the API. The model in ChatGPT does not know anything about your API other than what is defined in the OpenAPI specification and manifest file. This means that if you have an extensive API, you need not expose all functionality to the model and can choose specific endpoints. For example, if you have a social media API, you might want to have the model access content from the site through a GET request but prevent the model from being able to comment on users posts in order to reduce the chance of spam. - -The OpenAPI specification is the wrapper that sits on top of your API. - -We start by defining the specification version, the title, description, and version number. When a query is run in ChatGPT, it will look at the description that is defined in the info section to determine if the plugin is relevant for the user query. You can read more about prompting in the writing descriptions section. - -Keep in mind the following limits in your OpenAPI specification, which are subject to change: - -200 characters max for each API endpoint description/summary field in API specification -200 characters max for each API param description field in API specification -Since we are running this example locally, we want to set the server to point to your localhost URL. The rest of the OpenAPI specification follows the traditional OpenAPI format, you can learn more about OpenAPI formatting through various online resources. There are also many tools that auto generate OpenAPI specifications based on your underlying API code. - -## Running a plugin -Once you have created an API, manifest file, and OpenAPI specification for your API, you are now ready to connect the plugin via the ChatGPT UI. - -Using a local version of your API running, you can point the plugin interface to your localhost server. To connect the plugin with ChatGPT, navigate to the plugin store and select “Develop your own plugin”. Enter your localhost and port number (e.g localhost:3333). Note that only auth type none is currently supported for localhost development. - -## Other Notes -* Make sure to include a requirements.txt file for dependencies diff --git a/readme.md b/readme.md index 9deebe696..fe3f05212 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,7 @@ ### Quick Start generate a plugin for the Etherscan API to fetch Ethereum account balances -1. `python main_no_modal.py etherscan-plugin` +1. `python main_no_modal.py smol-plugin/prompts/plugins/etherscan.md` this takes a few mins to run 2. `cd generated && pip install -r requirements.txt` head into the generated repository and install requirements. There may be some dependency version issues, just remove them if that's case @@ -11,10 +11,10 @@ generate a plugin for the Etherscan API to fetch Ethereum account balances run your app. There may be some discreptancies between `openapi.yaml` and `app.py` routes that need to be fixed. 4. Test your plugin in on OpenAI Interface by plugging pointing it to `localhost:3333` -If you run into issues, you can see a working example in the `etherscan-plugin` repository. Note you will need an Etherscan key +If you run into issues, you can see a working example in the `smol-plugin/etherscan-plugin ` repository. Note you will need an Etherscan key ### Generate Your Own Plugin -1. Run `python plugin_generator.py` and input an **app_name** and **description**. This will auto generate a plugin template. +1. Run `cd smol-plugin && python plugin_generator.py` and input an **app_name** and **description**. This will auto generate a plugin template. 2. Run `main_mo_modal.py` on newly created **{app_name}.md** file 3. Repeat steps from quickstart. diff --git a/archive/anthropic.py b/smol-dev/archive/anthropic.py similarity index 100% rename from archive/anthropic.py rename to smol-dev/archive/anthropic.py diff --git a/archive/promptdeadend.md b/smol-dev/archive/promptdeadend.md similarity index 100% rename from archive/promptdeadend.md rename to smol-dev/archive/promptdeadend.md diff --git a/code2prompt-gpt3.md b/smol-dev/code2prompt/code2prompt-gpt3.md similarity index 100% rename from code2prompt-gpt3.md rename to smol-dev/code2prompt/code2prompt-gpt3.md diff --git a/code2prompt-gpt4.md b/smol-dev/code2prompt/code2prompt-gpt4.md similarity index 100% rename from code2prompt-gpt4.md rename to smol-dev/code2prompt/code2prompt-gpt4.md diff --git a/code2prompt.py b/smol-dev/code2prompt/code2prompt.py similarity index 100% rename from code2prompt.py rename to smol-dev/code2prompt/code2prompt.py diff --git a/code2prompt2code/background.js b/smol-dev/code2prompt/code2prompt2code/background.js similarity index 100% rename from code2prompt2code/background.js rename to smol-dev/code2prompt/code2prompt2code/background.js diff --git a/code2prompt2code/content_script.js b/smol-dev/code2prompt/code2prompt2code/content_script.js similarity index 100% rename from code2prompt2code/content_script.js rename to smol-dev/code2prompt/code2prompt2code/content_script.js diff --git a/code2prompt2code/icons/icon128.png b/smol-dev/code2prompt/code2prompt2code/icons/icon128.png similarity index 100% rename from code2prompt2code/icons/icon128.png rename to smol-dev/code2prompt/code2prompt2code/icons/icon128.png diff --git a/code2prompt2code/icons/icon16.png b/smol-dev/code2prompt/code2prompt2code/icons/icon16.png similarity index 100% rename from code2prompt2code/icons/icon16.png rename to smol-dev/code2prompt/code2prompt2code/icons/icon16.png diff --git a/code2prompt2code/icons/icon48.png b/smol-dev/code2prompt/code2prompt2code/icons/icon48.png similarity index 100% rename from code2prompt2code/icons/icon48.png rename to smol-dev/code2prompt/code2prompt2code/icons/icon48.png diff --git a/code2prompt2code/manifest.json b/smol-dev/code2prompt/code2prompt2code/manifest.json similarity index 100% rename from code2prompt2code/manifest.json rename to smol-dev/code2prompt/code2prompt2code/manifest.json diff --git a/code2prompt2code/popup.html b/smol-dev/code2prompt/code2prompt2code/popup.html similarity index 100% rename from code2prompt2code/popup.html rename to smol-dev/code2prompt/code2prompt2code/popup.html diff --git a/code2prompt2code/popup.js b/smol-dev/code2prompt/code2prompt2code/popup.js similarity index 100% rename from code2prompt2code/popup.js rename to smol-dev/code2prompt/code2prompt2code/popup.js diff --git a/code2prompt2code/shared_dependencies.md b/smol-dev/code2prompt/code2prompt2code/shared_dependencies.md similarity index 100% rename from code2prompt2code/shared_dependencies.md rename to smol-dev/code2prompt/code2prompt2code/shared_dependencies.md diff --git a/code2prompt2code/styles.css b/smol-dev/code2prompt/code2prompt2code/styles.css similarity index 100% rename from code2prompt2code/styles.css rename to smol-dev/code2prompt/code2prompt2code/styles.css diff --git a/debugger.py b/smol-dev/debugger/debugger.py similarity index 100% rename from debugger.py rename to smol-dev/debugger/debugger.py diff --git a/debugger_no_modal.py b/smol-dev/debugger/debugger_no_modal.py similarity index 100% rename from debugger_no_modal.py rename to smol-dev/debugger/debugger_no_modal.py diff --git a/exampleChromeExtension/background.js b/smol-dev/exampleChromeExtension/background.js similarity index 100% rename from exampleChromeExtension/background.js rename to smol-dev/exampleChromeExtension/background.js diff --git a/exampleChromeExtension/content_script.js b/smol-dev/exampleChromeExtension/content_script.js similarity index 100% rename from exampleChromeExtension/content_script.js rename to smol-dev/exampleChromeExtension/content_script.js diff --git a/etherscan-plugin/icon128.png b/smol-dev/exampleChromeExtension/icon128.png similarity index 100% rename from etherscan-plugin/icon128.png rename to smol-dev/exampleChromeExtension/icon128.png diff --git a/etherscan-plugin/icon16.png b/smol-dev/exampleChromeExtension/icon16.png similarity index 100% rename from etherscan-plugin/icon16.png rename to smol-dev/exampleChromeExtension/icon16.png diff --git a/etherscan-plugin/icon48.png b/smol-dev/exampleChromeExtension/icon48.png similarity index 100% rename from etherscan-plugin/icon48.png rename to smol-dev/exampleChromeExtension/icon48.png diff --git a/exampleChromeExtension/manifest.json b/smol-dev/exampleChromeExtension/manifest.json similarity index 100% rename from exampleChromeExtension/manifest.json rename to smol-dev/exampleChromeExtension/manifest.json diff --git a/exampleChromeExtension/popup.html b/smol-dev/exampleChromeExtension/popup.html similarity index 100% rename from exampleChromeExtension/popup.html rename to smol-dev/exampleChromeExtension/popup.html diff --git a/exampleChromeExtension/popup.js b/smol-dev/exampleChromeExtension/popup.js similarity index 100% rename from exampleChromeExtension/popup.js rename to smol-dev/exampleChromeExtension/popup.js diff --git a/exampleChromeExtension/prompt used for this extension.md b/smol-dev/exampleChromeExtension/prompt used for this extension.md similarity index 100% rename from exampleChromeExtension/prompt used for this extension.md rename to smol-dev/exampleChromeExtension/prompt used for this extension.md diff --git a/exampleChromeExtension/shared_dependencies.md b/smol-dev/exampleChromeExtension/shared_dependencies.md similarity index 100% rename from exampleChromeExtension/shared_dependencies.md rename to smol-dev/exampleChromeExtension/shared_dependencies.md diff --git a/exampleChromeExtension/styles.css b/smol-dev/exampleChromeExtension/styles.css similarity index 100% rename from exampleChromeExtension/styles.css rename to smol-dev/exampleChromeExtension/styles.css diff --git a/exampleChromeExtension/icon128.png b/smol-dev/generated/icon128.png similarity index 100% rename from exampleChromeExtension/icon128.png rename to smol-dev/generated/icon128.png diff --git a/exampleChromeExtension/icon16.png b/smol-dev/generated/icon16.png similarity index 100% rename from exampleChromeExtension/icon16.png rename to smol-dev/generated/icon16.png diff --git a/exampleChromeExtension/icon48.png b/smol-dev/generated/icon48.png similarity index 100% rename from exampleChromeExtension/icon48.png rename to smol-dev/generated/icon48.png diff --git a/test-for-alignment.py b/smol-dev/test-for-alignment.py similarity index 100% rename from test-for-alignment.py rename to smol-dev/test-for-alignment.py diff --git a/etherscan-plugin/.well-known/ai-plugin.json b/smol-plugin/etherscan-plugin/.well-known/ai-plugin.json similarity index 100% rename from etherscan-plugin/.well-known/ai-plugin.json rename to smol-plugin/etherscan-plugin/.well-known/ai-plugin.json diff --git a/etherscan-plugin/app.py b/smol-plugin/etherscan-plugin/app.py similarity index 100% rename from etherscan-plugin/app.py rename to smol-plugin/etherscan-plugin/app.py diff --git a/generated/icon128.png b/smol-plugin/etherscan-plugin/icon128.png similarity index 100% rename from generated/icon128.png rename to smol-plugin/etherscan-plugin/icon128.png diff --git a/generated/icon16.png b/smol-plugin/etherscan-plugin/icon16.png similarity index 100% rename from generated/icon16.png rename to smol-plugin/etherscan-plugin/icon16.png diff --git a/generated/icon48.png b/smol-plugin/etherscan-plugin/icon48.png similarity index 100% rename from generated/icon48.png rename to smol-plugin/etherscan-plugin/icon48.png diff --git a/etherscan-plugin/openapi.yaml b/smol-plugin/etherscan-plugin/openapi.yaml similarity index 100% rename from etherscan-plugin/openapi.yaml rename to smol-plugin/etherscan-plugin/openapi.yaml diff --git a/etherscan-plugin/requirements.txt b/smol-plugin/etherscan-plugin/requirements.txt similarity index 100% rename from etherscan-plugin/requirements.txt rename to smol-plugin/etherscan-plugin/requirements.txt diff --git a/etherscan-plugin/shared_dependencies.md b/smol-plugin/etherscan-plugin/shared_dependencies.md similarity index 100% rename from etherscan-plugin/shared_dependencies.md rename to smol-plugin/etherscan-plugin/shared_dependencies.md diff --git a/notes.md b/smol-plugin/notes.md similarity index 100% rename from notes.md rename to smol-plugin/notes.md diff --git a/plugin_generator.py b/smol-plugin/plugin_generator.py similarity index 89% rename from plugin_generator.py rename to smol-plugin/plugin_generator.py index e259f6da8..1e17bb04e 100644 --- a/plugin_generator.py +++ b/smol-plugin/plugin_generator.py @@ -5,7 +5,7 @@ app_name = input("Enter the app name: ") # Read the input .md file -with open('plugins.md', 'r') as file: +with open('./prompts/plugins/plugins.md', 'r') as file: filedata = file.read() # Replace the target string diff --git a/prompts/exaple.md b/smol-plugin/prompts/example.md similarity index 100% rename from prompts/exaple.md rename to smol-plugin/prompts/example.md diff --git a/etherscan-plugin.md b/smol-plugin/prompts/plugins/etherscan.md similarity index 100% rename from etherscan-plugin.md rename to smol-plugin/prompts/plugins/etherscan.md diff --git a/prompts/plugins/github.md b/smol-plugin/prompts/plugins/github.md similarity index 100% rename from prompts/plugins/github.md rename to smol-plugin/prompts/plugins/github.md diff --git a/prompts/plugins/openai.md b/smol-plugin/prompts/plugins/openai.md similarity index 100% rename from prompts/plugins/openai.md rename to smol-plugin/prompts/plugins/openai.md diff --git a/plugins.md b/smol-plugin/prompts/plugins/plugins.md similarity index 100% rename from plugins.md rename to smol-plugin/prompts/plugins/plugins.md