File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
content-script/selection-tools Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ export const defaultConfig = {
215
215
userLanguage : getNavigatorLanguage ( ) ,
216
216
apiModes : Object . keys ( Models ) ,
217
217
selectionTools : [
218
+ 'explain' ,
218
219
'translate' ,
219
220
'translateToEn' ,
220
221
'translateToZh' ,
@@ -227,6 +228,7 @@ export const defaultConfig = {
227
228
'ask' ,
228
229
] ,
229
230
selectionToolsDesc : [
231
+ 'Explain' ,
230
232
'Translate' ,
231
233
'Translate (To English)' ,
232
234
'Translate (Bidirectional)' ,
Original file line number Diff line number Diff line change @@ -7,10 +7,19 @@ import {
7
7
Translate ,
8
8
Braces ,
9
9
Globe ,
10
+ ChatTextFill ,
10
11
} from 'react-bootstrap-icons'
11
12
import { getPreferredLanguage } from '../../config/language.mjs'
12
13
13
14
export const config = {
15
+ explain : {
16
+ icon : < ChatTextFill /> ,
17
+ label : 'Explain' ,
18
+ genPrompt : async ( selection ) => {
19
+ const preferredLanguage = await getPreferredLanguage ( )
20
+ return `Reply in ${ preferredLanguage } .Explain the following:\n"${ selection } "`
21
+ } ,
22
+ } ,
14
23
translate : {
15
24
icon : < Translate /> ,
16
25
label : 'Translate' ,
You can’t perform that action at this time.
0 commit comments