appleboy / CodeGPT

A CLI written in Go language that writes git commit messages or do a code review brief for you using ChatGPT AI (gpt-4o, gpt-4-turbo, gpt-3.5-turbo model) and automatically installs a git prepare-commit-msg hook.
MIT License
1.16k stars 100 forks source link

Prompt issue: The commit message contains "請注意保留原有格式。" #120

Closed doggy8088 closed 8 months ago

doggy8088 commented 8 months ago

I'm trying to get a commit message and translate it to zh-tw.

codegpt commit --lang zh-tw --preview

The result:

工作:重構項目配置以增強安全性

- 在 csproj 文件中添加使用者秘密 ID
- 從 launchSettings.json 中刪除 http applicationUrl

請注意保留原有格式。

I think the 請注意保留原有格式。 is not necessary.

Also, the following footnote are shown from time to time:

I already tried to tune temperature to 0:

codegpt config set openai.temperature 0

It still happens.

Suggestion

Provide a way to configure FrequencyPenalty, NucleusSamplingFactor and PresencePenalty to 0.

appleboy commented 8 months ago

@doggy8088 Thanks for your feedback. https://github.com/appleboy/CodeGPT/releases/tag/v0.5.0 support top_p, frequency_penalty and presence_penalty parameters.

See the documentation here: https://github.com/appleboy/CodeGPT#setup

doggy8088 commented 8 months ago

I already tune down to 0 of the openai.temperature, openai.top_p, openai.presence_penalty and openai.frequency_penalty. The output still vary each time.

image

image

It seems impossible. What do you think?

appleboy commented 8 months ago

@doggy8088 Can you provide the git diff source or repo? I can try it out.

doggy8088 commented 8 months ago

Here:

diff --git a/Example.Admin/Example.Admin.csproj b/Example.Admin/Example.Admin.csproj
index 927f5d2..8869ce6 100644
--- a/Example.Admin/Example.Admin.csproj
+++ b/Example.Admin/Example.Admin.csproj
@@ -8,6 +8,7 @@
     <SpaProxyServerUrl>https://localhost:32565</SpaProxyServerUrl>
     <SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand>
     <ImplicitUsings>enable</ImplicitUsings>
+    <UserSecretsId>70fd13e8-e495-4b40-b74f-c689c60e3e00</UserSecretsId>
   </PropertyGroup>

   <PropertyGroup>
diff --git a/Example.Admin/Properties/launchSettings.json b/Example.Admin/Properties/launchSettings.json
index e821252..ca6efa7 100644
--- a/Example.Admin/Properties/launchSettings.json
+++ b/Example.Admin/Properties/launchSettings.json
@@ -11,7 +11,7 @@
     "Example.Admin": {
       "commandName": "Project",
       "launchBrowser": true,
-      "applicationUrl": "https://localhost:7124;http://localhost:5042",
+      "applicationUrl": "https://localhost:7124",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development",
         "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
doggy8088 commented 8 months ago

This issue is not happened anymore. I don't know why. 😅

appleboy commented 8 months ago

@doggy8088 What is your current config?

doggy8088 commented 8 months ago

@appleboy

Key                       Value
git.diff_unified          3
git.exclude_list
git.template_file
git.template_string
openai.api_key            ****************
openai.api_version
openai.base_url           https://*****.openai.azure.com/
openai.frequency_penalty  0
openai.headers
openai.max_tokens         300
openai.model              gpt-3.5-turbo
openai.model_name         gpt-3.5-turbo
openai.org_id
openai.presence_penalty   0
openai.provider           azure
openai.proxy
openai.skip_verify        false
openai.socks
openai.temperature        0
openai.timeout            10s
openai.top_p              0
output.lang               en