mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-09 05:16:59 +08:00
feat: code explain for selection tools
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
Palette,
|
||||
QuestionCircle,
|
||||
Translate,
|
||||
Braces,
|
||||
} from 'react-bootstrap-icons'
|
||||
import { getPreferredLanguage } from '../../config.mjs'
|
||||
|
||||
@@ -49,6 +50,14 @@ export const config = {
|
||||
genPrompt: async (selection) =>
|
||||
`Divide the following into paragraphs that are easy to read and understand:\n"${selection}"`,
|
||||
},
|
||||
code: {
|
||||
icon: <Braces />,
|
||||
label: 'Code Explain',
|
||||
genPrompt: async (selection) => {
|
||||
const preferredLanguage = await getPreferredLanguage()
|
||||
return `Reply in ${preferredLanguage}.Explain the following code:\n"${selection}"`
|
||||
},
|
||||
},
|
||||
ask: {
|
||||
icon: <QuestionCircle />,
|
||||
label: 'Ask',
|
||||
|
||||
Reference in New Issue
Block a user