Skip to content

Commit

Permalink
feat(chat): update custom agent chat and input section #51
Browse files Browse the repository at this point in the history
- Update CustomAgentChatProcessor.kt:
  - Replace the local message with the modified content without surrounding quotes.
  - Re-render the assistant output message.
  - Update the UI.

- Update AutoDevInputSection.kt:
  - Instead of updating the state property of CustomAgentConfig, assign the new state directly.

This commit adds improvements to the custom agent chat processor and input section in the chat feature.
  • Loading branch information
phodal committed Mar 7, 2024
1 parent d87eefc commit 451f644
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -48,7 +48,8 @@ class CustomAgentChatProcessor(val project: Project) {
sb.append(result)
}

llmProvider.appendLocalMessage(sb.toString(), ChatRole.Assistant)
val content = sb.toString().removeSurrounding("\"")
llmProvider.appendLocalMessage(content, ChatRole.Assistant)
message.reRenderAssistantOutput()
ui.hiddenProgressBar()
ui.updateUI()
Expand Down
Expand Up @@ -315,8 +315,8 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
}

fun resetAgent() {
(customRag.selectedItem as? CustomAgentConfig)?.state.let {
CustomAgentState.START
(customRag.selectedItem as? CustomAgentConfig)?.let {
it.state = CustomAgentState.START
}

customRag.selectedItem = defaultRag
Expand Down

0 comments on commit 451f644

Please sign in to comment.