Skip to content

Commit

Permalink
feat: add an option to customize prompt (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
phguo authored Mar 28, 2023
1 parent 2b5b6fd commit e075a48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
}
]
},
{
"identifier": "prompt",
"type": "text",
"title": "Prompt",
"defaultValue": "Revise the following sentences to make them more clear, concise, and coherent",
"desc": "通过自定义 prompt 获取不同的润色结果"
},
{
"identifier": "polishing_mode",
"type": "menu",
Expand Down
3 changes: 1 addition & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ function translate(query, completion) {
Authorization: `Bearer ${api_key}`,
};
const detailedPolishingMode = $option.polishing_mode === "detailed";
let prompt =
"Revise the following sentences to make them more clear, concise, and coherent";
let prompt = $option.prompt;
if (detailedPolishingMode) {
prompt = `${prompt}. Please note that you need to list the changes and briefly explain why`;
}
Expand Down

0 comments on commit e075a48

Please sign in to comment.