Skip to content

Commit e075a48

Browse files
authored
feat: add an option to customize prompt (#18)
1 parent 2b5b6fd commit e075a48

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/info.json

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
}
4848
]
4949
},
50+
{
51+
"identifier": "prompt",
52+
"type": "text",
53+
"title": "Prompt",
54+
"defaultValue": "Revise the following sentences to make them more clear, concise, and coherent",
55+
"desc": "通过自定义 prompt 获取不同的润色结果"
56+
},
5057
{
5158
"identifier": "polishing_mode",
5259
"type": "menu",

src/main.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ function translate(query, completion) {
1313
Authorization: `Bearer ${api_key}`,
1414
};
1515
const detailedPolishingMode = $option.polishing_mode === "detailed";
16-
let prompt =
17-
"Revise the following sentences to make them more clear, concise, and coherent";
16+
let prompt = $option.prompt;
1817
if (detailedPolishingMode) {
1918
prompt = `${prompt}. Please note that you need to list the changes and briefly explain why`;
2019
}

0 commit comments

Comments
 (0)