-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompt.go
95 lines (71 loc) · 1.55 KB
/
prompt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package main
import "fmt"
type PromptType int
const (
PrTitle PromptType = iota
PrBody
)
func CreateOpenAIQuestion(promptType PromptType, diffOutput string, japanise bool) string {
if japanise {
if promptType == PrTitle {
return fmt.Sprintf(`
コンテキストに基づいて適切なプルリクエストのタイトルを生成してください。
(タイトルのみを一行で出力してください。)
(git diffの結果を出力しないでください。)
%s`, diffOutput)
} else if promptType == PrBody {
return fmt.Sprintf(`
プルリクエストの説明を生成してください。
(git diffの結果を出力しないでください。)
以下はプルリクエスト説明フォーマットのサンプルです。
---
## 説明
* 説明
### 変更点
1. 変更点:
- 説明
2. 変更点:
- 説明
3. 変更点:
- 説明
...
...
...
### テスト
- 説明
---
%s`, diffOutput)
}
} else {
if promptType == PrTitle {
return fmt.Sprintf(`
Please generate an appropriate pull request title based on the context.
(Output only the title in one line.)
(Do not output the result of git diff)
%s`, diffOutput)
} else if promptType == PrBody {
return fmt.Sprintf(`
Please generate an appropriate pull request description based on the context.
(Do not output the result of git diff)
Here is a sample of pull-request description format.
---
## Description
* desc
### Changes
1. change:
- desc
2. change:
- desc
3. change:
- desc
...
...
...
### Testing
- desc
---
%s`, diffOutput)
}
}
return ""
}