Skip to content

Commit

Permalink
fix: fix comment code
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jul 18, 2023
1 parent bb0e9ed commit f46ac9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Expand Up @@ -18,10 +18,10 @@ class ChatCodingService(var actionType: ChatBotActionType) {
private val connectorFactory = ConnectorFactory.getInstance()

val action = when (actionType) {
ChatBotActionType.EXPLAIN -> "explain"
ChatBotActionType.REVIEW -> "review"
ChatBotActionType.REFACTOR -> "refactor"
ChatBotActionType.CODE_COMPLETE -> "complete"
ChatBotActionType.EXPLAIN -> "Write down what this code does"
ChatBotActionType.REVIEW -> "Code Review"
ChatBotActionType.REFACTOR -> "Refactor This code"
ChatBotActionType.CODE_COMPLETE -> "Auto Complete for this code"
ChatBotActionType.WRITE_TEST -> "write test"
ChatBotActionType.FIX_ISSUE -> "help me fix this"
ChatBotActionType.GEN_COMMIT_MESSAGE -> "generate commit message"
Expand Down
Expand Up @@ -28,9 +28,6 @@ data class PromptConfig(
companion object {
private val logger = Logger.getInstance(PromptConfig::class.java)

/**
* Load prompt config from settings
*/
fun load(): PromptConfig {
val config = tryParse(AutoDevSettingsState.getInstance().customEnginePrompts)
logger.info("Loaded prompt config: $config")
Expand All @@ -47,11 +44,11 @@ data class PromptConfig(
)

return PromptConfig(
PromptItem("Complete java code, return rest code, no explaining.", "{code}"),
PromptItem("Auto comment code", "{code}"),
PromptItem("Code review code", "{code}"),
PromptItem("Find bug", "{code}"),
PromptItem("Write test code for", "{code}"),
autoComplete = PromptItem("Complete java code, return rest code, no explaining.", "{code}"),
autoComment = PromptItem("Auto comment code", "{code}"),
codeReview = PromptItem("Code review code", "{code}"),
refactor = PromptItem("Refactor for follow code", "{code}"),
writeTest = PromptItem("Write test code for", "{code}"),
spec
)
}
Expand Down

0 comments on commit f46ac9f

Please sign in to comment.