From b944f935b4a891297d03933fbf7517e0eced93f3 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Sat, 29 Jun 2024 15:04:27 +0800 Subject: [PATCH] feat(InteractionType): add new interaction type and change defaults Added a new interaction type, 'InsertBeforeSelection', to the InteractionType enum. Also, commented out 'ChatPanel' interaction type and changed the default interaction type from 'ChatPanel' to 'AppendCursor'. --- .../kotlin/com/phodal/shirecore/agent/CustomAgent.kt | 2 +- .../com/phodal/shirecore/agent/InteractionType.kt | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/kotlin/com/phodal/shirecore/agent/CustomAgent.kt b/core/src/main/kotlin/com/phodal/shirecore/agent/CustomAgent.kt index 66e9bcf68..ad01db877 100644 --- a/core/src/main/kotlin/com/phodal/shirecore/agent/CustomAgent.kt +++ b/core/src/main/kotlin/com/phodal/shirecore/agent/CustomAgent.kt @@ -54,7 +54,7 @@ data class CustomAgent( val connector: ConnectorConfig? = null, val responseAction: CustomAgentResponseAction = CustomAgentResponseAction.Direct, val transition: List = emptyList(), - val interactive: InteractionType = InteractionType.ChatPanel, + val interactive: InteractionType = InteractionType.AppendCursor, val auth: CustomAgentAuth? = null, /** * Default to 10 minutes diff --git a/core/src/main/kotlin/com/phodal/shirecore/agent/InteractionType.kt b/core/src/main/kotlin/com/phodal/shirecore/agent/InteractionType.kt index da729b49a..aaac67e81 100644 --- a/core/src/main/kotlin/com/phodal/shirecore/agent/InteractionType.kt +++ b/core/src/main/kotlin/com/phodal/shirecore/agent/InteractionType.kt @@ -1,24 +1,26 @@ package com.phodal.shirecore.agent enum class InteractionType(val description: String) { - ChatPanel("Output results to the chat panel"), +// ChatPanel("Output results to the chat panel"), AppendCursor("Append content at the current cursor position"), AppendCursorStream("Append content at the current cursor position, stream output"), OutputFile("Output to a file"), ReplaceSelection("Replace the currently selected content"), - ReplaceCurrentFile("Replace the content of the current file") + ReplaceCurrentFile("Replace the content of the current file"), + InsertBeforeSelection("Insert content before the currently selected content"), ; companion object { fun from(interaction: String): InteractionType { return when (interaction) { - "ChatPanel" -> ChatPanel +// "ChatPanel" -> ChatPanel "AppendCursor" -> AppendCursor "AppendCursorStream" -> AppendCursorStream "OutputFile" -> OutputFile "ReplaceSelection" -> ReplaceSelection "ReplaceCurrentFile" -> ReplaceCurrentFile - else -> ChatPanel + "InsertBeforeSelection" -> InsertBeforeSelection + else -> AppendCursor } } }