Since the release of ChatGPT API on March 1st, I see the possibility that it can be a replacement for ChatGPT web for everyday use. So here I am, presenting to you the ChatGPT Conversation Action:
ChatGPT Conversation | Drafts Directory 617
Features
- Conversational chat in a draft, just like what ChatGPT web does
- Define the system role message to clarify the usage of the conversation for better results. This is made possible through the
role
property in the new API docs 54. - Update or delete the history message in the drafts to continuously improve the result you’ll get. While ChatGPT web cannot update or delete the history very efficiently.
Usage
First, install the action from the directory. Upon running the action, the OpenAI API key is required, which can be obtained from https://platform.openai.com/account/api-keys 153.
The simplest way to use it is to create a new draft and type whatever you would like to ask. Then, call the action, and the result will be appended to the end of the draft.
You can also add <!-- block system -->
at the top of the draft to tell ChatGPT what you want it to be. There are some curated prompts for your inspiration in this repo: Awesome ChatGPT Prompts 162
Note that the messages ChatGPT returns will be wrapped in <!-- block assistant -->
. The action will recognize them as assistant role messages and send them to the ChatGPT API as part of the conversation. So, don’t make the conversation too long; otherwise, the token will be consumed very quickly.
You can change the default behavior of using the whole draft as the context in the conversation by setting the template tag keep-context
to false
. This will make the action only send the system role message and the last user role message to ChatGPT API.
Here’s a screen record of how ChatGPT understands the context:
Enjoy!
Update notice 2023-03-11
- I’ve created a new template tag for the API called
api-base-url
. It serves as the default base URL for the API, which is set tohttps://api.openai.com/v1/
. However, it can be altered to another URL if necessary. Please note this change if you intend to use a custom API URL. - I’ve created another action called System Message Template 59. It simply creates a new draft with
<!-- block system -->
block so that you don’t need to copy-paste it every time.
Update notice 2023-04-08
- Template tag
api-base-url
was moved to credentials, meaning you should configure it when initializing this action. It’s called “OpenAI API Base URL (optional)”, as the name says, you can omit this option.