Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add replaceMessage option to openAIChat #1250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions source/OpenAIChat.popclipext/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ export const options = [
"Reset the conversation if idle for this many minutes. Set blank to disable.",
defaultValue: "15",
},
{
identifier: "replaceMessage",
label: "Replace the message.",
type: "boolean",
description: "Replace the original message with the polished texts.",
defaultValue: false,
},
{
identifier: "showReset",
label: "Show Reset Button",
Expand Down Expand Up @@ -127,10 +134,10 @@ const chat: ActionFunction<Options> = async (input, options) => {
messages.push(data.choices[0].message);
lastChat = new Date();

// if holding shift and option, paste just the response.
// if holding shift and option or selected replaceMessage option, paste just the response.
// if holding shift, copy just the response.
// else, paste the last input and response.
if (popclip.modifiers.shift && popclip.modifiers.option) {
if ((popclip.modifiers.shift && popclip.modifiers.option) || options.replaceMessage) {
popclip.pasteText(getTranscript(1));
} else if (popclip.modifiers.shift) {
popclip.copyText(getTranscript(1));
Expand Down