feat: 增加智能体对话体验配置
- 支持欢迎语、猜你想问和输入提示的编辑、草稿预览与发布态展示 - 补充配置校验、发布快照持久化和发布后回显修复
This commit is contained in:
@@ -9,6 +9,13 @@ import type {
|
||||
|
||||
import { computed, reactive } from 'vue';
|
||||
|
||||
import {
|
||||
buildInteractionConfigPayload,
|
||||
createEmptyInteractionConfig,
|
||||
normalizeInteractionConfig,
|
||||
validateInteractionConfig,
|
||||
} from '../interaction-config';
|
||||
|
||||
const BASE_NODE_ID = 'agent-base';
|
||||
const SAFE_TOOL_NAME_PATTERN = /^[\w-]+$/;
|
||||
|
||||
@@ -85,6 +92,7 @@ export function createEmptyAgent(): AgentInfo {
|
||||
minCompressionTokenThreshold: 6000,
|
||||
},
|
||||
},
|
||||
interactionConfigJson: createEmptyInteractionConfig(),
|
||||
status: 1,
|
||||
};
|
||||
}
|
||||
@@ -119,6 +127,9 @@ function normalizeAgent(agent?: AgentInfo): AgentInfo {
|
||||
defaultCompressionParameter.minCompressionTokenThreshold,
|
||||
},
|
||||
},
|
||||
interactionConfigJson: normalizeInteractionConfig(
|
||||
source.interactionConfigJson,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -160,7 +171,7 @@ function normalizeToolBinding(
|
||||
String(
|
||||
binding.id ||
|
||||
createLocalId(String(binding.toolType || 'tool').toLowerCase()),
|
||||
),
|
||||
),
|
||||
toolName: normalizeBindingToolName(binding),
|
||||
optionsJson,
|
||||
sortNo: binding.sortNo ?? index + 1,
|
||||
@@ -302,6 +313,9 @@ export function useAgentDesignerState() {
|
||||
message: '请选择模型',
|
||||
});
|
||||
}
|
||||
issues.push(
|
||||
...validateInteractionConfig(state.agent.interactionConfigJson),
|
||||
);
|
||||
state.knowledgeBindings.forEach((binding) => {
|
||||
if (!binding.knowledgeId) {
|
||||
issues.push({
|
||||
@@ -339,6 +353,9 @@ export function useAgentDesignerState() {
|
||||
memoryConfigJson;
|
||||
return {
|
||||
...state.agent,
|
||||
interactionConfigJson: buildInteractionConfigPayload(
|
||||
state.agent.interactionConfigJson,
|
||||
),
|
||||
memoryConfigJson: {
|
||||
...restMemoryConfigJson,
|
||||
compressionParameter: {
|
||||
|
||||
Reference in New Issue
Block a user