Skip to content

Commit 98d69f0

Browse files
committed
fix: update prompt for md
fix #7 fix #3 fix #14
1 parent c928c2e commit 98d69f0

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist
33
out
44
.vscode-test/
55
*.vsix
6+
example.md

packages/utils-ai-vscode/src/commands/correct.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function correctCommand(context: vscode.ExtensionContext) {
1717
return
1818
}
1919

20-
const prompt = getPrompt('spell-checker', 'en')
20+
const prompt = getPrompt('spell-checker-md', 'en')
2121
const filename = editor.document.fileName
2222
const text = editor.document.getText()
2323

packages/utils-ai/src/cli/commands/correct.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default defineCommand({
6262

6363
const file = readFileSync(args.filename, 'utf-8')
6464

65-
const prompt = getPrompt('spell-checker', config.preferredLanguage)
65+
const prompt = getPrompt('spell-checker-md', config.preferredLanguage)
6666

6767
const correctedText = await correct(file, prompt.message, {
6868
...config,

packages/utils-ai/src/prompts.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ export const languages: Language[] = ['fr', 'en']
44

55
export const prompts: Prompts = {
66
fr: {
7-
'spell-checker': {
7+
'spell-checker-md': {
88
name: 'Correcteur orthographique',
9-
message: 'Tu es un correcteur orthographique. Tu dois corriger les fautes d\'orthographe dans le texte suivant. Tu ne dois pas changer le sens du texte. Tu ne dois rien ajouter d`autres que le texte corrigé.',
9+
message: 'Tu es un correcteur orthographique. Tu dois corriger les fautes d\'orthographe dans le texte écrit en markdown suivant. Tu ne dois pas changer le sens du texte. Tu ne dois rien dire d\'autres que le texte corrigé.',
1010
},
1111
'descriptor': {
1212
name: 'Génération d\'une description',
1313
message: 'Tu es un générateur de description. Tu dois générer une description du texte suivant. La description doit être court, pas plus de 2 phrases. La description doit donner envie de lire le texte.',
1414
},
1515
},
1616
en: {
17-
'spell-checker': {
17+
'spell-checker-md': {
1818
name: 'Spell checker',
19-
message: 'You are a spell checker. You must correct the spelling mistakes in the following text. You must not change the meaning of the text. You must not add anything other than the corrected text. Do not touch URLs.',
19+
message: 'You are a spell checker. You must correct the spelling mistakes in the following text written using markdown. You must not change the meaning of the text. You must not say anything other than the corrected text.',
2020
},
2121
'descriptor': {
2222
name: 'Description generation',

packages/utils-ai/src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export type Language = 'fr' | 'en'
1313

1414
export type Prompts = Record<Language, Record<PromptName, Prompt>>
1515

16-
export type PromptName = 'spell-checker' | 'descriptor'
16+
export type PromptLanguage = 'md'
17+
export type PromptName = `spell-checker-${PromptLanguage}` | 'descriptor'
1718

1819
export interface Prompt {
1920
name: string

0 commit comments

Comments
 (0)