adds: configuration for the commit-message system prompt (#304)

* adds: configuration for the commit-message system prompt

this will remove the default file and move it to the code to be overwritten if the user chooses to modify the prompt.

* fix: checkstyle

---------

Co-authored-by: Carl-Robert Linnupuu <carlrobertoh@gmail.com>
This commit is contained in:
René 2023-12-09 13:48:10 +01:00 committed by GitHub
parent c36d4dd566
commit c214b59f55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 5 deletions

View file

@ -1,5 +1,6 @@
package ee.carlrobert.codegpt.settings.configuration;
import static ee.carlrobert.codegpt.completions.CompletionRequestProvider.COMPLETION_COMMIT_MESSAGE_PROMPT;
import static ee.carlrobert.codegpt.completions.CompletionRequestProvider.COMPLETION_SYSTEM_PROMPT;
import com.intellij.openapi.application.ApplicationManager;
@ -18,6 +19,7 @@ import org.jetbrains.annotations.Nullable;
public class ConfigurationState implements PersistentStateComponent<ConfigurationState> {
private String systemPrompt = COMPLETION_SYSTEM_PROMPT;
private String commitMessagePrompt = COMPLETION_COMMIT_MESSAGE_PROMPT;
private int maxTokens = 1000;
private double temperature = 0.1;
private boolean checkForPluginUpdates = true;
@ -46,10 +48,18 @@ public class ConfigurationState implements PersistentStateComponent<Configuratio
return systemPrompt;
}
public String getCommitMessagePrompt() {
return commitMessagePrompt;
}
public void setSystemPrompt(String systemPrompt) {
this.systemPrompt = systemPrompt;
}
public void setCommitMessagePrompt(String commitMessagePrompt) {
this.commitMessagePrompt = commitMessagePrompt;
}
public int getMaxTokens() {
return maxTokens;
}