Skip to content

Commit 451f644

Browse files
committed
feat(chat): update custom agent chat and input section #51
- 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.
1 parent d87eefc commit 451f644

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/kotlin/cc/unitmesh/devti/counit/CustomAgentChatProcessor.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class CustomAgentChatProcessor(val project: Project) {
4848
sb.append(result)
4949
}
5050

51-
llmProvider.appendLocalMessage(sb.toString(), ChatRole.Assistant)
51+
val content = sb.toString().removeSurrounding("\"")
52+
llmProvider.appendLocalMessage(content, ChatRole.Assistant)
5253
message.reRenderAssistantOutput()
5354
ui.hiddenProgressBar()
5455
ui.updateUI()

src/main/kotlin/cc/unitmesh/devti/gui/chat/AutoDevInputSection.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
315315
}
316316

317317
fun resetAgent() {
318-
(customRag.selectedItem as? CustomAgentConfig)?.state.let {
319-
CustomAgentState.START
318+
(customRag.selectedItem as? CustomAgentConfig)?.let {
319+
it.state = CustomAgentState.START
320320
}
321321

322322
customRag.selectedItem = defaultRag

0 commit comments

Comments
 (0)