Skip to content
Open
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions src/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@
"value": "text-davinci-002"
}
]
},
{
"identifier": "prompt_zh",
"type": "text",
"title": "Prompt",
"defaultValue": "润色此句",
"desc": "中文润色Prompt (比如:润色此句,更学术化)",
},
{
"identifier": "prompt_en",
"type": "text",
"title": "Prompt",
"defaultValue": "polish this sentence",
"desc": "英文润色Prompt (比如:polish this sentence, make it more academic)",
},
{
"identifier": "max_tokens",
"type": "text",
"title": "Max tokens",
"defaultValue": "1000",
"desc": "最大Token数 (max ~4000)",
}
]
}
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ function translate(query, completion) {
systemPrompt =
"You are a text embellisher, you can only embellish the text, don't interpret it.";
if (query.detectTo === "zh-Hant" || query.detectTo === "zh-Hans") {
userPrompt = "润色此句";
userPrompt = $option.prompt_zh || "润色此句";
} else {
userPrompt = "polish this sentence";
userPrompt = $option.prompt_en ||"polish this sentence";
}
}
const body = {
model: $option.model,
temperature: 0,
max_tokens: 1000,
max_tokens: Number($option.max_tokens),
top_p: 1,
frequency_penalty: 1,
presence_penalty: 1,
Expand Down