mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
feat(tool-feedback): add separate message mode for chat feedback (#2644)
* feat(tool-feedback): add separate message mode for chat feedback * add parameter in conf
This commit is contained in:
@@ -244,6 +244,7 @@ export function ConfigPage() {
|
||||
tool_feedback: {
|
||||
enabled: form.toolFeedbackEnabled,
|
||||
max_args_length: toolFeedbackMaxArgsLength,
|
||||
separate_messages: form.toolFeedbackSeparateMessages,
|
||||
},
|
||||
max_tokens: maxTokens,
|
||||
context_window: contextWindow,
|
||||
|
||||
@@ -113,6 +113,18 @@ export function AgentDefaultsSection({
|
||||
}
|
||||
/>
|
||||
|
||||
{form.toolFeedbackEnabled && (
|
||||
<SwitchCardField
|
||||
label={t("pages.config.tool_feedback_separate_messages")}
|
||||
hint={t("pages.config.tool_feedback_separate_messages_hint")}
|
||||
layout="setting-row"
|
||||
checked={form.toolFeedbackSeparateMessages}
|
||||
onCheckedChange={(checked) =>
|
||||
onFieldChange("toolFeedbackSeparateMessages", checked)
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
{form.toolFeedbackEnabled && (
|
||||
<Field
|
||||
label={t("pages.config.tool_feedback_max_args_length")}
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface CoreConfigForm {
|
||||
splitOnMarker: boolean
|
||||
toolFeedbackEnabled: boolean
|
||||
toolFeedbackMaxArgsLength: string
|
||||
toolFeedbackSeparateMessages: boolean
|
||||
execEnabled: boolean
|
||||
allowRemote: boolean
|
||||
enableDenyPatterns: boolean
|
||||
@@ -71,6 +72,7 @@ export const EMPTY_FORM: CoreConfigForm = {
|
||||
splitOnMarker: false,
|
||||
toolFeedbackEnabled: false,
|
||||
toolFeedbackMaxArgsLength: "300",
|
||||
toolFeedbackSeparateMessages: false,
|
||||
execEnabled: true,
|
||||
allowRemote: true,
|
||||
enableDenyPatterns: true,
|
||||
@@ -154,6 +156,10 @@ export function buildFormFromConfig(config: unknown): CoreConfigForm {
|
||||
toolFeedback.max_args_length,
|
||||
EMPTY_FORM.toolFeedbackMaxArgsLength,
|
||||
),
|
||||
toolFeedbackSeparateMessages:
|
||||
toolFeedback.separate_messages === undefined
|
||||
? EMPTY_FORM.toolFeedbackSeparateMessages
|
||||
: asBool(toolFeedback.separate_messages),
|
||||
execEnabled:
|
||||
exec.enabled === undefined
|
||||
? EMPTY_FORM.execEnabled
|
||||
|
||||
@@ -606,6 +606,8 @@
|
||||
"split_on_marker_hint": "Split long messages into short ones like real human chatting.",
|
||||
"tool_feedback_enabled": "Tool Feedback",
|
||||
"tool_feedback_enabled_hint": "Send a short execution note into the current chat before each tool runs.",
|
||||
"tool_feedback_separate_messages": "Separate Feedback Messages",
|
||||
"tool_feedback_separate_messages_hint": "Keep each tool feedback update as its own chat message instead of reusing a single placeholder/progress message.",
|
||||
"tool_feedback_max_args_length": "Tool Feedback Length",
|
||||
"tool_feedback_max_args_length_hint": "Maximum number of characters shown in each tool feedback message. Set to 0 to use the default.",
|
||||
"exec_enabled": "Allow Commands",
|
||||
|
||||
@@ -606,6 +606,8 @@
|
||||
"split_on_marker_hint": "像真人聊天一样,把长难句拆成多条短消息快速发出",
|
||||
"tool_feedback_enabled": "工具反馈",
|
||||
"tool_feedback_enabled_hint": "在每次执行工具前,先向当前会话发送一条简短的执行说明",
|
||||
"tool_feedback_separate_messages": "分开发送反馈消息",
|
||||
"tool_feedback_separate_messages_hint": "让每次工具反馈都保留为独立消息,而不是反复复用同一条占位/进度消息",
|
||||
"tool_feedback_max_args_length": "工具反馈长度",
|
||||
"tool_feedback_max_args_length_hint": "每条工具反馈消息中展示的字符上限。设为 0 时使用默认值",
|
||||
"exec_enabled": "允许命令执行",
|
||||
|
||||
Reference in New Issue
Block a user