Skip to content

Commit

Permalink
fix(actions): fix variable name in CommitMessageSuggestionAction
Browse files Browse the repository at this point in the history
Changed variable name from historyExample to historyExamples for clarity and consistency.
  • Loading branch information
phodal committed Mar 21, 2024
1 parent 0b23f53 commit edc3e8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -2,6 +2,14 @@ package cc.unitmesh.devti.language.completion.dataprovider

import cc.unitmesh.devti.agent.model.CustomAgentConfig

/**
* The tool hub provides a list of tools - agents and commands for the AI Agent to decide which one to call
* For example, you prompt could be:
* ```devin
* Here is the tools you can use:
* $agent
* ```
*/
enum class ToolHub(val summaryName: String, val type: String, val description: String) {
AGENT("Agent", CustomAgentConfig::class.simpleName.toString(), "DevIns all agent for AI Agent to call"),
COMMAND("Command", BuiltinCommand::class.simpleName.toString(), "DevIns all commands for AI Agent to call"),
Expand Down
Expand Up @@ -146,15 +146,15 @@ class CommitMessageSuggestionAction : ChatBaseAction() {
val templateRender = TemplateRender("genius/practises")
val template = templateRender.getTemplate("gen-commit-msg.vm")

val historyExample = try {
val historyExamples = try {
findExampleCommitMessages(project) ?: ""
} catch (e: Exception) {
logger.warn("Cannot get example commit messages.", e)
""
}

templateRender.context = CommitMsgGenContext(
historyExample = historyExample,
historyExamples = historyExamples,
diffContent = diff,
)
val prompter = templateRender.renderTemplate(template)
Expand All @@ -166,6 +166,6 @@ class CommitMessageSuggestionAction : ChatBaseAction() {


data class CommitMsgGenContext(
var historyExample: String = "",
var historyExamples: String = "",
var diffContent: String = "",
)

0 comments on commit edc3e8c

Please sign in to comment.