New extension: ChatGPT

A pre-packaged version of the ChatGPT extension, which evolved as a snippet over on this topic. This version includes some refinements, described below.

ChatGPT

Send the selected text to ChatGPT, and append the response.

Download: ChatGPT.popclipextz

View in directory

Description

The main action, Chat, sends the selected text to OpenAI’s ChatGPT and
appends the response as a new line.

As a modifier, if you hold the Shift (⇧) key while invoking the action, the
response will be copied to the clipboard instead of appended to the selection.

The previous messages in the chat are sent along with each new message, allowing
an extended dialogue with the AI.

The Reset action (broom icon) clears the current chat history to start a
fresh conversation.

Configuration

API Key

To use this extension, you need to provide it with an API Key for an OpenAI
account. To get an API Key:

  1. Sign up for an OpenAI Account here: https://platform.openai.com/

  2. Generate an API key here: https://platform.openai.com/account/api-keys

  3. Copy and paste the API Key (it starts with sk-) into the API Key field in
    the extension’s settings.

Reset Timer (minutes)

After this many minutes without any messages, the extension will automatically
reset the conversation. Set it blank to never reset, and set it to 0 to always
reset. The default value is 15 minutes.

Show Reset Button

Control whether or not to show the reset action in the popup.

About

This is an extension for PopClip.

Author

Nick Moore

Acknowledgements

Icons:

Requirements

Requires PopClip 2022.12 and an Open AI Platform account.

Links

Changelog

2023-03-03.1

  • Add a configurable reset timer.

2023-03-03

  • Initial release.
4 Likes

AMAZING

(As an AI language model, I don’t have the ability to feel emotions or express opinions on things, but I am designed to help you with any questions or concerns you may have. Is there anything else I can assist you with?!)

Post the link to support you on this amazing app please.

What platform do you use to run this forum?

‘tis Discourse.

Trying it … I have a correct API key set and it shows on the openai website and it’s been used. But all I get it the chatgpt icon shaking giving me nothing.

SC 2023-03-03 at 18.27.34

1 Like

If your OpenAI account is more than three months old, your free credits will have expired, and it may be that you have to add some credit to your account.

Failing that, here are some debug instructions (copied from another thread):

Enable extension debug output by pasting the following command in Terminal:

defaults write com.pilotmoon.popclip EnableExtensionDebug -bool YES

then Quit and restart PopClip.

(note, substitute com.pilotmoon.popclip-setapp if using Setapp edition)

Then open Console app and set the following filters process: PopClip, category: Extension

Now set Console to “Start” & “Now” you should see the API calls going in, and the responses.

Once you’ve set up the debug console, there should be some clue in the error messages from OpenAI as to the problem.

You’re right, I didn’t know I needed tokens for the API because we can use chat GPT for free.

“message”: “You exceeded your current quota, please check your plan and billing details.”,

Thanks!

1 Like

Is the GPT3.5 or GPT4 model used here? Can the extension choose which model the user would like to use?

It’s gpt-3.5-turbo. The extension doesn’t have an option to change the model but this may be a good addition.

I’ve mad a small update today, so that when an error occurs, it displays the actual error message, instead of just an X.

1 Like

I have a paid plan, and I am still getting this message. I did the Terminal trick above and I still get the code 429. I emailed Open AI to see why.

@AppCrazee – I’ve replied in your other thread, but in summary (for anyone reading) you need to have pre-paid API credits on your OpenAI account. API usage is not included in ChatGPT Plus subscription.

1 Like

I’ve just updated the extension to include a model selection option. Available values are gpt-3.5-turbo and gpt-4.

To update, you will need to re-download extension from ChatGPT — PopClip Extensions.

1 Like

Ok, so I added $20 and boom, it worked. Thank you. Is there a way I could use this functionality to re-write my highlighted text? That would be a huge daily assist. Thank you. Or do you have to include that prompt in the text you are selecting? (which adds a step)

Updated: If you add “rewrite” to your text, it works like magic. Any way to have that inserted automagically?

My Test:

rewrite: Ultimately, the choice between building a website for yourself or for a client depends on your goals, preferences, and available opportunities.

Ultimately, the decision to build a website for yourself or for a client depends on your individual goals, preferences, and the opportunities that are available to you.

I’ve updated the extension. Now, if you hold If you hold Option+Shift when you click the action, it will paste the answer over the selected text.

Like this:

CleanShot 2023-09-16 at 05.28.38

Also holding Shift will continue to just copy the response as before.

Redownload from ChatGPT — PopClip Extensions

Rockstar!!! Thank you :+1: :+1: :+1: :+1: :+1: this is useful!

Is it possible to add certain conditions?

I often use Chat GPT to assist me in writing, which means I constantly have to prefix it with what I want. If I could simply select the text and be asked to rewrite, correct, or improve it, it would be of great help to me :)m’aider dans l’écriture, ce qui signifie que je dois constamment le préfixer de ce que je souhaite. Si je pouvais simplement sélectionner le texte et que l’on me demande de le réécrire, corriger ou améliorer, cela me serait d’une grande aide :slight_smile:


Est-ce possible d’ajouter certaines conditions ?

J’utilise souvent Chat GPT pour m’aider dans l’écriture, ce qui signifie que je dois constamment le préfixer de ce que je souhaite. Si je pouvais simplement sélectionner le texte et que l’on me demande de le réécrire, corriger ou améliorer, cela me serait d’une grande aide :slight_smile:

Amazing, thanks!
Is there an easy way to get the answer on a small pop-up window?

No. Result window is a big missing feature for PopClip IMO.

1 Like

2 posts were split to a new topic: ChatGPT ext - option for base URL