Skip to content

Commit f3a7000

Browse files
Refine built-in prompts
1 parent 705e961 commit f3a7000

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/content-script/menu-tools/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const config = {
1313
summarizePage: {
1414
label: 'Summarize Page',
1515
genPrompt: async () => {
16-
return `The following is the text content of a web page, analyze the core content and summarize:\n${getCoreContentText()}`
16+
return `You are an expert summarizer. Carefully analyze the following web page content and provide a concise summary focusing on the key points:\n${getCoreContentText()}`
1717
},
1818
},
1919
openConversationPage: {

src/content-script/selection-tools/index.mjs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ const createGenPrompt =
2727
}
2828

2929
let fullMessage = isTranslation
30-
? `Translate the following into ${preferredLanguage} and only show me the translated content`
30+
? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result.`
3131
: message
3232
if (enableBidirectional) {
33-
fullMessage += `. If it is already in ${preferredLanguage}, translate it into English and only show me the translated content`
33+
fullMessage += ` If the text is already in ${preferredLanguage}, translate it into English instead following the same requirements. Only provide the translated result.`
3434
}
3535
const prefix = includeLanguagePrefix ? `Reply in ${preferredLanguage}.` : ''
3636
return `${prefix}${fullMessage}:\n'''\n${selection}\n'''`
@@ -41,7 +41,8 @@ export const config = {
4141
icon: <ChatText />,
4242
label: 'Explain',
4343
genPrompt: createGenPrompt({
44-
message: 'Explain the following',
44+
message:
45+
'You are an expert teacher. Explain the following content in simple terms and highlight the key points',
4546
includeLanguagePrefix: true,
4647
}),
4748
},
@@ -80,7 +81,8 @@ export const config = {
8081
icon: <CardHeading />,
8182
label: 'Summary',
8283
genPrompt: createGenPrompt({
83-
message: 'Summarize the following as concisely as possible',
84+
message:
85+
'You are a professional summarizer. Summarize the following content in a few sentences, focusing on the key points',
8486
includeLanguagePrefix: true,
8587
}),
8688
},
@@ -89,38 +91,41 @@ export const config = {
8991
label: 'Polish',
9092
genPrompt: createGenPrompt({
9193
message:
92-
'Check the following content for possible diction and grammar problems, and polish it carefully',
94+
'Act as a skilled editor. Correct grammar and word choice in the following text, improve readability and flow while preserving the original meaning, and return only the polished version',
9395
}),
9496
},
9597
sentiment: {
9698
icon: <EmojiSmile />,
9799
label: 'Sentiment Analysis',
98100
genPrompt: createGenPrompt({
99101
message:
100-
'Analyze the sentiments expressed in the following content and make a brief summary of the sentiments',
102+
'You are an expert in sentiment analysis. Analyze the following content and provide a brief summary of the overall emotional tone, labeling it with a short descriptive word or phrase',
101103
includeLanguagePrefix: true,
102104
}),
103105
},
104106
divide: {
105107
icon: <CardList />,
106108
label: 'Divide Paragraphs',
107109
genPrompt: createGenPrompt({
108-
message: 'Divide the following into paragraphs that are easy to read and understand',
110+
message:
111+
'You are a skilled editor. Divide the following text into clear, easy-to-read and easy-to-understand paragraphs',
109112
}),
110113
},
111114
code: {
112115
icon: <Braces />,
113116
label: 'Code Explain',
114117
genPrompt: createGenPrompt({
115-
message: 'Explain the following code',
118+
message:
119+
'You are a senior software engineer and system architect. Break down the following code step by step, explain how each part works and why it was designed that way, note any potential issues, and summarize the overall purpose',
116120
includeLanguagePrefix: true,
117121
}),
118122
},
119123
ask: {
120124
icon: <QuestionCircle />,
121125
label: 'Ask',
122126
genPrompt: createGenPrompt({
123-
message: 'Analyze the following content and express your opinion, or give your answer',
127+
message:
128+
'Analyze the following content carefully and provide a concise answer or opinion with a short explanation',
124129
includeLanguagePrefix: true,
125130
}),
126131
},

0 commit comments

Comments
 (0)