You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(readme): add support for customizable prompt templates and configuration (#229)
- Add support for customizing prompt templates and variables
- Introduce `prompt.folder` configuration with a default location
- Add detailed instructions on how to customize the default prompt folder
- Update OpenAI model configuration value from `gpt-35-turbo` to `gpt-4o`
Signed-off-by: appleboy <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ A CLI written in [Go](https://go.dev) that writes git commit messages or provide
29
29
- Supports socks proxy or custom network HTTP proxy.
30
30
- Supports [model lists](https://github.com/appleboy/CodeGPT/blob/bf28f000463cfc6dfa2572df61e1b160c5c680f7/openai/openai.go#L18-L38) like `gpt-4`, `gpt-4o`, etc.
31
31
- Supports generating a brief code review.
32
+
- Supports customizing prompt template and variables.
32
33
33
34

34
35
@@ -100,6 +101,30 @@ This will create a `.codegpt.yaml` file in your home directory ($HOME/.config/co
100
101
|**openai.top_p**| Default top_p is `1.0`. See reference [top_p](https://platform.openai.com/docs/api-reference/completions/create#completions/create-top_p). |
101
102
|**openai.frequency_penalty**| Default frequency_penalty is `0.0`. See reference [frequency_penalty](https://platform.openai.com/docs/api-reference/completions/create#completions/create-frequency_penalty). |
102
103
|**openai.presence_penalty**| Default presence_penalty is `0.0`. See reference [presence_penalty](https://platform.openai.com/docs/api-reference/completions/create#completions/create-presence_penalty). |
104
+
|**prompt.folder**| Default prompt folder is `$HOME/.config/codegpt/prompt`. |
105
+
106
+
### How to Customize the Default Prompt Folder
107
+
108
+
The default prompt folder is located at `$HOME/.config/codegpt/prompt`. You can change this to another directory by executing:
109
+
110
+
```sh
111
+
codegpt config set prompt.folder /path/to/your/prompt
112
+
```
113
+
114
+
To load the prompt files from the custom folder, run:
115
+
116
+
```sh
117
+
codegpt prompt --load
118
+
```
119
+
120
+
Upon execution, you will see messages similar to the following:
121
+
122
+
```sh
123
+
save code_review_file_diff.tmpl to /Users/xxxxx/.config/codegpt/prompt/code_review_file_diff.tmpl
124
+
save summarize_file_diff.tmpl to /Users/xxxxx/.config/codegpt/prompt/summarize_file_diff.tmpl
125
+
save summarize_title.tmpl to /Users/xxxxx/.config/codegpt/prompt/summarize_title.tmpl
126
+
save conventional_commit.tmpl to /Users/xxxxx/.config/codegpt/prompt/conventional_commit.tmpl
127
+
```
103
128
104
129
### How to change to Azure OpenAI Service
105
130
@@ -115,7 +140,7 @@ Update your config file.
115
140
codegpt config set openai.provider azure
116
141
codegpt config set openai.base_url https://xxxxxxxxx.openai.azure.com/
117
142
codegpt config set openai.api_key xxxxxxxxxxxxxxxx
118
-
codegpt config set openai.model xxxxx-gpt-35-turbo
0 commit comments