|
1 | 1 | package com.github.blarc.ai.commits.intellij.plugin.settings.prompts |
2 | 2 |
|
3 | | -enum class DefaultPrompts(val title: String, val description: String, val content: String) { |
| 3 | +enum class DefaultPrompts(val prompt: Prompt) { |
4 | 4 |
|
5 | 5 | // Generate UUIDs for game objects in Mine.py and call the function in start_game(). |
6 | 6 | BASIC( |
7 | | - "Basic", |
8 | | - "Basic prompt that generates a decent commit message.", |
9 | | - "Write an insightful but concise Git commit message in a complete sentence in present tense for the " + |
10 | | - "following diff without prefacing it with anything, the response must be in the language {locale} and must " + |
11 | | - "NOT be longer than 74 characters. The sent text will be the differences between files, where deleted lines " + |
12 | | - "are prefixed with a single minus sign and added lines are prefixed with a single plus sign.\n" + |
13 | | - "{Use this hint to improve this commit message: \$hint\n}" + |
14 | | - "{diff}" |
| 7 | + Prompt( |
| 8 | + "Basic", |
| 9 | + "Basic prompt that generates a decent commit message.", |
| 10 | + "Write an insightful but concise Git commit message in a complete sentence in present tense for the " + |
| 11 | + "following diff without prefacing it with anything, the response must be in the language {locale} and must " + |
| 12 | + "NOT be longer than 74 characters. The sent text will be the differences between files, where deleted lines " + |
| 13 | + "are prefixed with a single minus sign and added lines are prefixed with a single plus sign.\n" + |
| 14 | + "{Use this hint to improve the commit message: \$hint}\n" + |
| 15 | + "{diff}", |
| 16 | + false |
| 17 | + ) |
15 | 18 | ), |
| 19 | + |
16 | 20 | // feat: generate unique UUIDs for game objects on Mine game start |
17 | 21 | CONVENTIONAL( |
18 | | - "Conventional", |
19 | | - "Prompt for commit message in the conventional commit convention.", |
20 | | - "Write a commit message in the conventional commit convention. I'll send you an output " + |
21 | | - "of 'git diff --staged' command, and you convert it into a commit message. " + |
22 | | - "Lines must not be longer than 74 characters. Use {locale} language to answer. " + |
23 | | - "End commit title with issue number if you can get it from the branch name: " + |
24 | | - "{branch} in parenthesis.\n" + |
25 | | - "{Use this hint to improve this commit message: \$hint\n}" + |
26 | | - "{diff}", |
| 22 | + Prompt( |
| 23 | + "Conventional", |
| 24 | + "Prompt for commit message in the conventional commit convention.", |
| 25 | + "Write a commit message in the conventional commit convention. I'll send you an output " + |
| 26 | + "of 'git diff --staged' command, and you convert it into a commit message. " + |
| 27 | + "Lines must not be longer than 74 characters. Use {locale} language to answer. " + |
| 28 | + "End commit title with issue number if you can get it from the branch name: " + |
| 29 | + "{branch} in parenthesis.\n" + |
| 30 | + "{Use this hint to improve the commit message: \$hint}\n" + |
| 31 | + "{diff}", |
| 32 | + false |
| 33 | + ) |
27 | 34 | ), |
| 35 | + |
28 | 36 | // ✨ feat(mine): Generate objects UUIDs and start team timers on game start |
29 | 37 | EMOJI( |
30 | | - "Emoji", |
31 | | - "Prompt for commit message in the conventional commit convention with GitMoji convention.", |
32 | | - "Write a clean and comprehensive commit message in the conventional commit convention. " + |
33 | | - "I'll send you an output of 'git diff --staged' command, and you convert " + |
34 | | - "it into a commit message. " + |
35 | | - "Use GitMoji convention to preface the commit. " + |
36 | | - "Do NOT add any descriptions to the commit, only commit message. " + |
37 | | - "Use the present tense. " + |
38 | | - "Lines must not be longer than 74 characters. " + |
39 | | - "{Use this hint to improve this commit message: \$hint\n}" + |
40 | | - "Use {locale} language to answer.\n" + |
41 | | - "{diff}", |
| 38 | + Prompt( |
| 39 | + "Emoji", |
| 40 | + "Prompt for commit message in the conventional commit convention with GitMoji convention.", |
| 41 | + "Write a clean and comprehensive commit message in the conventional commit convention. " + |
| 42 | + "I'll send you an output of 'git diff --staged' command, and you convert " + |
| 43 | + "it into a commit message. " + |
| 44 | + "Use GitMoji convention to preface the commit. " + |
| 45 | + "Do NOT add any descriptions to the commit, only commit message. " + |
| 46 | + "Use the present tense. " + |
| 47 | + "Lines must not be longer than 74 characters.\n" + |
| 48 | + "{Use this hint to improve the commit message: \$hint}\n" + |
| 49 | + "Use {locale} language to answer.\n" + |
| 50 | + "{diff}", |
| 51 | + false |
| 52 | + ) |
42 | 53 | ); |
43 | 54 |
|
44 | 55 | companion object { |
45 | 56 | fun toPromptsMap(): MutableMap<String, Prompt> { |
46 | | - return entries.associateBy({ it.name.lowercase() }, DefaultPrompts::toPrompt).toMutableMap() |
| 57 | + return entries.associateBy({ it.name.lowercase() }, { it.prompt }).toMutableMap() |
47 | 58 | } |
48 | 59 | } |
49 | | - |
50 | | - fun toPrompt(): Prompt { |
51 | | - return Prompt( |
52 | | - this.title, |
53 | | - this.content, |
54 | | - this.description, |
55 | | - false |
56 | | - ) |
57 | | - } |
58 | 60 | } |
0 commit comments