vue-agent-start 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +30 -0
- package/pnpm-workspace.yaml +3 -0
- package/src/agent-flow/adapter/backend.ts +99 -0
- package/src/agent-flow/components/ChatIframePanel.vue +773 -0
- package/src/agent-flow/components/DatasetItemCard.vue +313 -0
- package/src/agent-flow/components/MemoryWindow.vue +104 -0
- package/src/agent-flow/components/PromptEditor.vue +804 -0
- package/src/agent-flow/components/PromptEditorTagPanel.vue +460 -0
- package/src/agent-flow/components/SvgIcon.vue +32 -0
- package/src/agent-flow/components/ToolItemCard.vue +169 -0
- package/src/agent-flow/components/VariableCard.vue +161 -0
- package/src/agent-flow/components/VariableSelector.vue +162 -0
- package/src/agent-flow/components/chat-iframe-types.ts +35 -0
- package/src/agent-flow/components/stubs/DatasetChooser.vue +70 -0
- package/src/agent-flow/components/stubs/Embedding.vue +22 -0
- package/src/agent-flow/components/stubs/ModelSelect.vue +24 -0
- package/src/agent-flow/components/stubs/RestfulSelectCard.vue +24 -0
- package/src/agent-flow/components/stubs/ToolChooser.vue +96 -0
- package/src/agent-flow/components/stubs/TriggersItemCard.vue +126 -0
- package/src/agent-flow/components/stubs/VariableModal.vue +115 -0
- package/src/agent-flow/index.ts +73 -0
- package/src/agent-flow/stores/workflow.ts +72 -0
- package/src/agent-flow/utils/langUtils.ts +173 -0
- package/src/agent-flow/workflow/Ability.vue +65 -0
- package/src/agent-flow/workflow/AuthorizationItem.vue +101 -0
- package/src/agent-flow/workflow/ConversationVar.vue +42 -0
- package/src/agent-flow/workflow/CustomEdge.vue +94 -0
- package/src/agent-flow/workflow/EnvironmentVar.vue +40 -0
- package/src/agent-flow/workflow/FlowDesigner.vue +2802 -0
- package/src/agent-flow/workflow/Icon.vue +179 -0
- package/src/agent-flow/workflow/NodeConfig.vue +509 -0
- package/src/agent-flow/workflow/NodeConfigCard.vue +460 -0
- package/src/agent-flow/workflow/NodeHandle.vue +147 -0
- package/src/agent-flow/workflow/NodeHeaderToolbar.vue +77 -0
- package/src/agent-flow/workflow/NodeHoverToolbar.vue +176 -0
- package/src/agent-flow/workflow/OutputItemCard.vue +668 -0
- package/src/agent-flow/workflow/ParamTableItem.vue +200 -0
- package/src/agent-flow/workflow/StructTable.vue +202 -0
- package/src/agent-flow/workflow/VarInsertField.vue +517 -0
- package/src/agent-flow/workflow/VarSelectField.vue +223 -0
- package/src/agent-flow/workflow/VariableSelectorItem.vue +48 -0
- package/src/agent-flow/workflow/WfField.vue +206 -0
- package/src/agent-flow/workflow/_config-base.css +470 -0
- package/src/agent-flow/workflow/composables/useNode.js +55 -0
- package/src/agent-flow/workflow/index.vue +53 -0
- package/src/agent-flow/workflow/nodeCard/AgentNodeCard.vue +180 -0
- package/src/agent-flow/workflow/nodeCard/AnswerNodeCard.vue +65 -0
- package/src/agent-flow/workflow/nodeCard/ClassifierCard.vue +152 -0
- package/src/agent-flow/workflow/nodeCard/CodeNodeCard.vue +139 -0
- package/src/agent-flow/workflow/nodeCard/ConditionNodeCard.vue +323 -0
- package/src/agent-flow/workflow/nodeCard/DocumentExtractorCard.vue +83 -0
- package/src/agent-flow/workflow/nodeCard/EndNodeCard.vue +123 -0
- package/src/agent-flow/workflow/nodeCard/HttpNodeCard.vue +451 -0
- package/src/agent-flow/workflow/nodeCard/HumanInputCard.vue +152 -0
- package/src/agent-flow/workflow/nodeCard/IterationCard.vue +66 -0
- package/src/agent-flow/workflow/nodeCard/KnowledgeRetrievalCard.vue +48 -0
- package/src/agent-flow/workflow/nodeCard/LLMNodeCard.vue +206 -0
- package/src/agent-flow/workflow/nodeCard/ListOperatorCard.vue +188 -0
- package/src/agent-flow/workflow/nodeCard/ParameterExtractorCard.vue +352 -0
- package/src/agent-flow/workflow/nodeCard/ServiceApiNodeCard.vue +188 -0
- package/src/agent-flow/workflow/nodeCard/StartNodeCard.vue +216 -0
- package/src/agent-flow/workflow/nodeCard/VariableAssignerCard.vue +125 -0
- package/src/agent-flow/workflow/nodeCard/VariableNodeCard.vue +121 -0
- package/src/agent-flow/workflow/nodes/AgentNode.vue +122 -0
- package/src/agent-flow/workflow/nodes/AnswerNode.vue +99 -0
- package/src/agent-flow/workflow/nodes/ClassifierNode.vue +199 -0
- package/src/agent-flow/workflow/nodes/CodeNode.vue +152 -0
- package/src/agent-flow/workflow/nodes/ConditionNode.vue +232 -0
- package/src/agent-flow/workflow/nodes/DocumentExtractorNode.vue +96 -0
- package/src/agent-flow/workflow/nodes/EndNode.vue +119 -0
- package/src/agent-flow/workflow/nodes/FileUploadNode.vue +97 -0
- package/src/agent-flow/workflow/nodes/HttpNode.vue +204 -0
- package/src/agent-flow/workflow/nodes/HumanInputNode.vue +110 -0
- package/src/agent-flow/workflow/nodes/IterationNode.vue +98 -0
- package/src/agent-flow/workflow/nodes/KnowledgeRetrievalNode.vue +253 -0
- package/src/agent-flow/workflow/nodes/LLMNode.vue +134 -0
- package/src/agent-flow/workflow/nodes/ListOperatorNode.vue +111 -0
- package/src/agent-flow/workflow/nodes/LoopNode.vue +94 -0
- package/src/agent-flow/workflow/nodes/ParameterExtractorNode.vue +147 -0
- package/src/agent-flow/workflow/nodes/ServiceApiNode.vue +161 -0
- package/src/agent-flow/workflow/nodes/StartNode.vue +199 -0
- package/src/agent-flow/workflow/nodes/TemplateNode.vue +103 -0
- package/src/agent-flow/workflow/nodes/UserInputNode.vue +92 -0
- package/src/agent-flow/workflow/nodes/VariableAssignerNode.vue +145 -0
- package/src/agent-flow/workflow/nodes/VariableNode.vue +130 -0
- package/src/agent-flow/workflow/nodes/_node-base.css +338 -0
- package/src/agent-flow/workflow/utils/node_card_form.ts +335 -0
- package/src/agent-flow/workflow/utils/node_config.ts +63 -0
- package/src/agent-flow/workflow/utils/workflow_utils.ts +151 -0
- package/src/agent-studio/adapters/springAgentStart.ts +390 -0
- package/src/agent-studio/api/index.ts +1 -0
- package/src/agent-studio/api/types.ts +173 -0
- package/src/agent-studio/components/AgentApiDocs.vue +500 -0
- package/src/agent-studio/components/AgentAppsPage.vue +1601 -0
- package/src/agent-studio/components/AgentCardGrid.vue +259 -0
- package/src/agent-studio/components/AgentChatPage.vue +553 -0
- package/src/agent-studio/components/AgentDebugPanel.vue +350 -0
- package/src/agent-studio/components/AgentLogsPanel.vue +391 -0
- package/src/agent-studio/components/AgentMonitorPanel.vue +204 -0
- package/src/agent-studio/components/AgentOrchestrate.vue +505 -0
- package/src/agent-studio/components/AgentPromptEditor.vue +237 -0
- package/src/agent-studio/components/AgentStudioShell.vue +227 -0
- package/src/agent-studio/components/AgentToolsPanel.vue +394 -0
- package/src/agent-studio/components/AgentVariablesPanel.vue +205 -0
- package/src/agent-studio/components/ApiKeyManager.vue +251 -0
- package/src/agent-studio/components/AppDesignDrawer.vue +3391 -0
- package/src/agent-studio/components/CreateAppModal.vue +737 -0
- package/src/agent-studio/components/SparkChart.vue +200 -0
- package/src/agent-studio/components/VariableEditorModal.vue +499 -0
- package/src/agent-studio/composables/useAgentStudio.ts +347 -0
- package/src/agent-studio/index.ts +60 -0
- package/src/agent-studio/panels/DrawerFlowDesigner.vue +203 -0
- package/src/agent-studio/panels/LogAnnotationPanel.vue +490 -0
- package/src/agent-studio/panels/MonitorPanel.vue +535 -0
- package/src/agent-studio/types.ts +242 -0
- package/src/index.ts +155 -0
- package/src/knowledge-hub/adapters/springAgentStart.ts +472 -0
- package/src/knowledge-hub/components/AddDocumentsWizard.vue +1452 -0
- package/src/knowledge-hub/components/CreateDatasetWizard.vue +1723 -0
- package/src/knowledge-hub/components/DatasetCardGrid.vue +467 -0
- package/src/knowledge-hub/components/DatasetDetailDrawer.vue +888 -0
- package/src/knowledge-hub/components/DatasetPicker.vue +65 -0
- package/src/knowledge-hub/components/DatasetPickerModal.vue +526 -0
- package/src/knowledge-hub/components/DatasetSettingsPanel.vue +908 -0
- package/src/knowledge-hub/components/DatasetSidebar.vue +781 -0
- package/src/knowledge-hub/components/DocumentChunksView.vue +802 -0
- package/src/knowledge-hub/components/DocumentTable.vue +552 -0
- package/src/knowledge-hub/components/HitTestingPanel.vue +74 -0
- package/src/knowledge-hub/components/KnowledgeApp.vue +66 -0
- package/src/knowledge-hub/components/KnowledgeHubApp.vue +504 -0
- package/src/knowledge-hub/components/RecallTestingPanelV2.vue +515 -0
- package/src/knowledge-hub/components/RetrievalConfigPopover.vue +270 -0
- package/src/knowledge-hub/components/RetrievalMethodPicker.vue +547 -0
- package/src/knowledge-hub/components/RetrievedList.vue +24 -0
- package/src/knowledge-hub/components/internal/KhDialog.vue +195 -0
- package/src/knowledge-hub/composables/useKnowledge.ts +89 -0
- package/src/knowledge-hub/i18n/index.ts +2 -0
- package/src/knowledge-hub/i18n/messages.ts +422 -0
- package/src/knowledge-hub/i18n/useKhI18n.ts +107 -0
- package/src/knowledge-hub/index.ts +46 -0
- package/src/knowledge-hub/styles/index.css +4 -0
- package/src/knowledge-hub/styles/tokens.css +138 -0
- package/src/knowledge-hub/types/api.ts +213 -0
- package/src/knowledge-hub/types/dataset.ts +88 -0
- package/src/knowledge-hub/types/document.ts +45 -0
- package/src/knowledge-hub/types/index.ts +9 -0
- package/src/knowledge-hub/types/retrieval.ts +46 -0
- package/src/provider-hub/components/CredentialForm.vue +103 -0
- package/src/provider-hub/components/DefaultModelsPanel.vue +270 -0
- package/src/provider-hub/components/GroupedModelSelect.vue +445 -0
- package/src/provider-hub/components/ModelCardGrid.vue +332 -0
- package/src/provider-hub/components/ModelParameterDrawer.vue +739 -0
- package/src/provider-hub/components/ModelPickerPopover.vue +1282 -0
- package/src/provider-hub/components/ProviderApp.vue +159 -0
- package/src/provider-hub/components/ProviderCredentialModal.vue +321 -0
- package/src/provider-hub/components/ProviderGallery.vue +131 -0
- package/src/provider-hub/components/ProviderHubShell.vue +1992 -0
- package/src/provider-hub/components/ProviderIcon.vue +130 -0
- package/src/provider-hub/composables/useProviderHub.ts +358 -0
- package/src/provider-hub/index.ts +43 -0
- package/src/provider-hub/svg/MiniMax.svg +1 -0
- package/src/provider-hub/svg/Volcengine.svg +1 -0
- package/src/provider-hub/svg/Zhipu.svg +1 -0
- package/src/provider-hub/svg/deepseek.svg +1 -0
- package/src/provider-hub/svg/moonshot.svg +1 -0
- package/src/provider-hub/svg/openai.svg +1 -0
- package/src/provider-hub/svg/qwen.svg +1 -0
- package/src/provider-hub/svg/siliconflow.svg +1 -0
- package/src/provider-hub/types.ts +256 -0
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactive, ref, watch } from 'vue';
|
|
3
|
+
|
|
4
|
+
import Icon from './Icon.vue';
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
node: {
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const emit = defineEmits(['update', 'delete']);
|
|
14
|
+
|
|
15
|
+
const localData = reactive({
|
|
16
|
+
id: props.node.id,
|
|
17
|
+
label: props.node.data?.label || '',
|
|
18
|
+
description: props.node.data?.description || '',
|
|
19
|
+
config: { ...props.node.data?.config },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const headerKeys = ref(Object.keys(localData.config.headers || {}));
|
|
23
|
+
|
|
24
|
+
watch(
|
|
25
|
+
() => props.node,
|
|
26
|
+
(newNode) => {
|
|
27
|
+
localData.id = newNode.id;
|
|
28
|
+
localData.label = newNode.data?.label || '';
|
|
29
|
+
localData.description = newNode.data?.description || '';
|
|
30
|
+
localData.config = { ...newNode.data?.config };
|
|
31
|
+
headerKeys.value = Object.keys(localData.config.headers || {});
|
|
32
|
+
},
|
|
33
|
+
{ deep: true },
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const updateData = () => {
|
|
37
|
+
emit('update', {
|
|
38
|
+
data: {
|
|
39
|
+
label: localData.label,
|
|
40
|
+
description: localData.description,
|
|
41
|
+
config: localData.config,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const addHeader = () => {
|
|
47
|
+
if (!localData.config.headers) {
|
|
48
|
+
localData.config.headers = {};
|
|
49
|
+
}
|
|
50
|
+
const newKey = `header-${Date.now()}`;
|
|
51
|
+
localData.config.headers[newKey] = '';
|
|
52
|
+
headerKeys.value.push(newKey);
|
|
53
|
+
updateData();
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const removeHeader = (key) => {
|
|
57
|
+
delete localData.config.headers[key];
|
|
58
|
+
headerKeys.value = headerKeys.value.filter((k) => k !== key);
|
|
59
|
+
updateData();
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const updateHeaders = () => {
|
|
63
|
+
const newHeaders = {};
|
|
64
|
+
headerKeys.value.forEach((key, index) => {
|
|
65
|
+
if (key) {
|
|
66
|
+
newHeaders[key] = Object.values(localData.config.headers)[index] || '';
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
localData.config.headers = newHeaders;
|
|
70
|
+
updateData();
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const addCondition = () => {
|
|
74
|
+
if (!localData.config.conditions) {
|
|
75
|
+
localData.config.conditions = [];
|
|
76
|
+
}
|
|
77
|
+
localData.config.conditions.push({ expression: '' });
|
|
78
|
+
updateData();
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const removeCondition = (index) => {
|
|
82
|
+
localData.config.conditions.splice(index, 1);
|
|
83
|
+
updateData();
|
|
84
|
+
};
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<div class="node-config">
|
|
89
|
+
<!-- 基本信息 -->
|
|
90
|
+
<div class="config-section">
|
|
91
|
+
<div class="section-title">基本信息</div>
|
|
92
|
+
<div class="form-group">
|
|
93
|
+
<label>节点名称</label>
|
|
94
|
+
<input
|
|
95
|
+
v-model="localData.label"
|
|
96
|
+
@input="updateData"
|
|
97
|
+
class="form-input"
|
|
98
|
+
placeholder="输入节点名称"
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="form-group">
|
|
102
|
+
<label>节点描述</label>
|
|
103
|
+
<textarea
|
|
104
|
+
v-model="localData.description"
|
|
105
|
+
@input="updateData"
|
|
106
|
+
class="form-textarea"
|
|
107
|
+
placeholder="输入节点描述"
|
|
108
|
+
rows="2"
|
|
109
|
+
></textarea>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<!-- LLM 节点配置 -->
|
|
114
|
+
<div class="config-section" v-if="node.type === 'LLM'">
|
|
115
|
+
<div class="section-title">模型配置</div>
|
|
116
|
+
<div class="form-group">
|
|
117
|
+
<label>模型选择</label>
|
|
118
|
+
<select
|
|
119
|
+
v-model="localData.config.model"
|
|
120
|
+
@change="updateData"
|
|
121
|
+
class="form-select"
|
|
122
|
+
>
|
|
123
|
+
<option value="gpt-3.5-turbo">GPT-3.5 Turbo</option>
|
|
124
|
+
<option value="gpt-4">GPT-4</option>
|
|
125
|
+
<option value="gpt-4-turbo">GPT-4 Turbo</option>
|
|
126
|
+
<option value="claude-3-sonnet">Claude 3 Sonnet</option>
|
|
127
|
+
<option value="claude-3-opus">Claude 3 Opus</option>
|
|
128
|
+
</select>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="form-group">
|
|
131
|
+
<label>温度 ({{ localData.config.temperature }})</label>
|
|
132
|
+
<input
|
|
133
|
+
type="range"
|
|
134
|
+
min="0"
|
|
135
|
+
max="2"
|
|
136
|
+
step="0.1"
|
|
137
|
+
v-model="localData.config.temperature"
|
|
138
|
+
@input="updateData"
|
|
139
|
+
class="form-range"
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
<div class="form-group">
|
|
143
|
+
<label>最大令牌数</label>
|
|
144
|
+
<input
|
|
145
|
+
type="number"
|
|
146
|
+
v-model="localData.config.max_tokens"
|
|
147
|
+
@input="updateData"
|
|
148
|
+
class="form-input"
|
|
149
|
+
min="1"
|
|
150
|
+
max="4000"
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="form-group">
|
|
154
|
+
<label>系统提示词</label>
|
|
155
|
+
<textarea
|
|
156
|
+
v-model="localData.config.prompt"
|
|
157
|
+
@input="updateData"
|
|
158
|
+
class="form-textarea"
|
|
159
|
+
placeholder="输入系统提示词..."
|
|
160
|
+
rows="4"
|
|
161
|
+
></textarea>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<!-- HTTP 节点配置 -->
|
|
166
|
+
<div class="config-section" v-if="node.type === 'HTTP_REQUEST'">
|
|
167
|
+
<div class="section-title">HTTP 配置</div>
|
|
168
|
+
<div class="form-group">
|
|
169
|
+
<label>请求方法</label>
|
|
170
|
+
<select
|
|
171
|
+
v-model="localData.config.method"
|
|
172
|
+
@change="updateData"
|
|
173
|
+
class="form-select"
|
|
174
|
+
>
|
|
175
|
+
<option value="GET">GET</option>
|
|
176
|
+
<option value="POST">POST</option>
|
|
177
|
+
<option value="PUT">PUT</option>
|
|
178
|
+
<option value="DELETE">DELETE</option>
|
|
179
|
+
<option value="PATCH">PATCH</option>
|
|
180
|
+
</select>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="form-group">
|
|
183
|
+
<label>请求 URL</label>
|
|
184
|
+
<input
|
|
185
|
+
v-model="localData.config.url"
|
|
186
|
+
@input="updateData"
|
|
187
|
+
class="form-input"
|
|
188
|
+
placeholder="https://api.example.com/endpoint"
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
<div class="form-group">
|
|
192
|
+
<label>请求头</label>
|
|
193
|
+
<div class="headers-editor">
|
|
194
|
+
<div
|
|
195
|
+
v-for="(value, key, index) in localData.config.headers"
|
|
196
|
+
:key="index"
|
|
197
|
+
class="header-item"
|
|
198
|
+
>
|
|
199
|
+
<input
|
|
200
|
+
v-model="headerKeys[index]"
|
|
201
|
+
@input="updateHeaders"
|
|
202
|
+
class="header-key"
|
|
203
|
+
placeholder="键"
|
|
204
|
+
/>
|
|
205
|
+
<input
|
|
206
|
+
v-model="localData.config.headers[key]"
|
|
207
|
+
@input="updateData"
|
|
208
|
+
class="header-value"
|
|
209
|
+
placeholder="值"
|
|
210
|
+
/>
|
|
211
|
+
<button @click="removeHeader(key)" class="remove-btn">×</button>
|
|
212
|
+
</div>
|
|
213
|
+
<button @click="addHeader" class="add-btn">+ 添加请求头</button>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div
|
|
217
|
+
class="form-group"
|
|
218
|
+
v-if="['POST', 'PUT', 'PATCH'].includes(localData.config.method)"
|
|
219
|
+
>
|
|
220
|
+
<label>请求体</label>
|
|
221
|
+
<textarea
|
|
222
|
+
v-model="localData.config.body"
|
|
223
|
+
@input="updateData"
|
|
224
|
+
class="form-textarea"
|
|
225
|
+
placeholder="JSON 格式的请求体..."
|
|
226
|
+
rows="4"
|
|
227
|
+
></textarea>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<!-- 代码节点配置 -->
|
|
232
|
+
<div class="config-section" v-if="node.type === 'CODE'">
|
|
233
|
+
<div class="section-title">代码配置</div>
|
|
234
|
+
<div class="form-group">
|
|
235
|
+
<label>编程语言</label>
|
|
236
|
+
<select
|
|
237
|
+
v-model="localData.config.language"
|
|
238
|
+
@change="updateData"
|
|
239
|
+
class="form-select"
|
|
240
|
+
>
|
|
241
|
+
<option value="python">Python</option>
|
|
242
|
+
<option value="javascript">JavaScript</option>
|
|
243
|
+
<option value="typescript">TypeScript</option>
|
|
244
|
+
<option value="java">Java</option>
|
|
245
|
+
<option value="go">Go</option>
|
|
246
|
+
</select>
|
|
247
|
+
</div>
|
|
248
|
+
<div class="form-group">
|
|
249
|
+
<label>代码内容</label>
|
|
250
|
+
<textarea
|
|
251
|
+
v-model="localData.config.code"
|
|
252
|
+
@input="updateData"
|
|
253
|
+
class="form-textarea code-editor"
|
|
254
|
+
placeholder="输入代码..."
|
|
255
|
+
rows="10"
|
|
256
|
+
></textarea>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<!-- 知识检索节点配置 -->
|
|
261
|
+
<div class="config-section" v-if="node.type === 'KNOWLEDGE_RETRIEVAL'">
|
|
262
|
+
<div class="section-title">知识检索配置</div>
|
|
263
|
+
<div class="form-group">
|
|
264
|
+
<label>数据集</label>
|
|
265
|
+
<select
|
|
266
|
+
v-model="localData.config.dataset"
|
|
267
|
+
@change="updateData"
|
|
268
|
+
class="form-select"
|
|
269
|
+
>
|
|
270
|
+
<option value="">选择数据集</option>
|
|
271
|
+
<option value="knowledge-base-1">知识库 1</option>
|
|
272
|
+
<option value="knowledge-base-2">知识库 2</option>
|
|
273
|
+
<option value="faq-dataset">FAQ 数据集</option>
|
|
274
|
+
</select>
|
|
275
|
+
</div>
|
|
276
|
+
<div class="form-group">
|
|
277
|
+
<label>Top K</label>
|
|
278
|
+
<input
|
|
279
|
+
type="number"
|
|
280
|
+
v-model="localData.config.top_k"
|
|
281
|
+
@input="updateData"
|
|
282
|
+
class="form-input"
|
|
283
|
+
min="1"
|
|
284
|
+
max="10"
|
|
285
|
+
/>
|
|
286
|
+
</div>
|
|
287
|
+
<div class="form-group">
|
|
288
|
+
<label>查询表达式</label>
|
|
289
|
+
<input
|
|
290
|
+
v-model="localData.config.query"
|
|
291
|
+
@input="updateData"
|
|
292
|
+
class="form-input"
|
|
293
|
+
placeholder="输入查询表达式..."
|
|
294
|
+
/>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
<!-- 条件节点配置 -->
|
|
299
|
+
<div class="config-section" v-if="node.type === 'IF_ELSE'">
|
|
300
|
+
<div class="section-title">条件配置</div>
|
|
301
|
+
<div class="conditions-editor">
|
|
302
|
+
<div
|
|
303
|
+
v-for="(condition, index) in localData.config.conditions"
|
|
304
|
+
:key="index"
|
|
305
|
+
class="condition-item"
|
|
306
|
+
>
|
|
307
|
+
<input
|
|
308
|
+
v-model="condition.expression"
|
|
309
|
+
@input="updateData"
|
|
310
|
+
class="form-input"
|
|
311
|
+
placeholder="条件表达式"
|
|
312
|
+
/>
|
|
313
|
+
<button @click="removeCondition(index)" class="remove-btn">×</button>
|
|
314
|
+
</div>
|
|
315
|
+
<button @click="addCondition" class="add-btn">+ 添加条件</button>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
<!-- 回复节点配置 -->
|
|
320
|
+
<div class="config-section" v-if="node.type === 'ANSWER'">
|
|
321
|
+
<div class="section-title">回复配置</div>
|
|
322
|
+
<div class="form-group">
|
|
323
|
+
<label>回复内容</label>
|
|
324
|
+
<textarea
|
|
325
|
+
v-model="localData.config.text"
|
|
326
|
+
@input="updateData"
|
|
327
|
+
class="form-textarea"
|
|
328
|
+
placeholder="输入回复内容..."
|
|
329
|
+
rows="4"
|
|
330
|
+
></textarea>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
<!-- 操作按钮 -->
|
|
335
|
+
<div class="config-actions">
|
|
336
|
+
<button @click="$emit('delete')" class="btn btn-danger">
|
|
337
|
+
<Icon name="close" />
|
|
338
|
+
删除节点
|
|
339
|
+
</button>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</template>
|
|
343
|
+
|
|
344
|
+
<style scoped>
|
|
345
|
+
.node-config {
|
|
346
|
+
height: 100%;
|
|
347
|
+
overflow-y: auto;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.config-section {
|
|
351
|
+
margin-bottom: 24px;
|
|
352
|
+
padding-bottom: 16px;
|
|
353
|
+
border-bottom: 1px solid #f3f4f6;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.config-section:last-child {
|
|
357
|
+
border-bottom: none;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.section-title {
|
|
361
|
+
font-size: 14px;
|
|
362
|
+
font-weight: 600;
|
|
363
|
+
color: #374151;
|
|
364
|
+
margin-bottom: 12px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.form-group {
|
|
368
|
+
margin-bottom: 16px;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.form-group label {
|
|
372
|
+
display: block;
|
|
373
|
+
font-size: 12px;
|
|
374
|
+
font-weight: 500;
|
|
375
|
+
color: #374151;
|
|
376
|
+
margin-bottom: 6px;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.form-input,
|
|
380
|
+
.form-select,
|
|
381
|
+
.form-textarea {
|
|
382
|
+
width: 100%;
|
|
383
|
+
padding: 8px 12px;
|
|
384
|
+
border: 1px solid #d1d5db;
|
|
385
|
+
border-radius: 6px;
|
|
386
|
+
font-size: 13px;
|
|
387
|
+
transition: border-color 0.2s;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.form-input:focus,
|
|
391
|
+
.form-select:focus,
|
|
392
|
+
.form-textarea:focus {
|
|
393
|
+
outline: none;
|
|
394
|
+
border-color: #6366f1;
|
|
395
|
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.form-textarea {
|
|
399
|
+
resize: vertical;
|
|
400
|
+
min-height: 60px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.form-textarea.code-editor {
|
|
404
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
405
|
+
font-size: 12px;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.form-range {
|
|
409
|
+
width: 100%;
|
|
410
|
+
margin: 8px 0;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.headers-editor,
|
|
414
|
+
.conditions-editor {
|
|
415
|
+
border: 1px solid #e5e7eb;
|
|
416
|
+
border-radius: 6px;
|
|
417
|
+
padding: 12px;
|
|
418
|
+
background: #f9fafb;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.header-item,
|
|
422
|
+
.condition-item {
|
|
423
|
+
display: flex;
|
|
424
|
+
gap: 8px;
|
|
425
|
+
margin-bottom: 8px;
|
|
426
|
+
align-items: center;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.header-item:last-child,
|
|
430
|
+
.condition-item:last-child {
|
|
431
|
+
margin-bottom: 0;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.header-key,
|
|
435
|
+
.header-value {
|
|
436
|
+
flex: 1;
|
|
437
|
+
padding: 6px 8px;
|
|
438
|
+
border: 1px solid #d1d5db;
|
|
439
|
+
border-radius: 4px;
|
|
440
|
+
font-size: 12px;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.remove-btn {
|
|
444
|
+
background: #ef4444;
|
|
445
|
+
color: white;
|
|
446
|
+
border: none;
|
|
447
|
+
border-radius: 4px;
|
|
448
|
+
width: 24px;
|
|
449
|
+
height: 24px;
|
|
450
|
+
display: flex;
|
|
451
|
+
align-items: center;
|
|
452
|
+
justify-content: center;
|
|
453
|
+
cursor: pointer;
|
|
454
|
+
font-size: 14px;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.remove-btn:hover {
|
|
458
|
+
background: #dc2626;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.add-btn {
|
|
462
|
+
background: #f3f4f6;
|
|
463
|
+
color: #374151;
|
|
464
|
+
border: 1px dashed #d1d5db;
|
|
465
|
+
border-radius: 4px;
|
|
466
|
+
padding: 8px 12px;
|
|
467
|
+
font-size: 12px;
|
|
468
|
+
cursor: pointer;
|
|
469
|
+
width: 100%;
|
|
470
|
+
transition: all 0.2s;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.add-btn:hover {
|
|
474
|
+
background: #e5e7eb;
|
|
475
|
+
border-color: #9ca3af;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.config-actions {
|
|
479
|
+
margin-top: 24px;
|
|
480
|
+
padding-top: 16px;
|
|
481
|
+
border-top: 1px solid #f3f4f6;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.btn {
|
|
485
|
+
display: flex;
|
|
486
|
+
align-items: center;
|
|
487
|
+
gap: 6px;
|
|
488
|
+
padding: 10px 16px;
|
|
489
|
+
border: none;
|
|
490
|
+
border-radius: 6px;
|
|
491
|
+
font-size: 13px;
|
|
492
|
+
font-weight: 500;
|
|
493
|
+
cursor: pointer;
|
|
494
|
+
transition: all 0.2s;
|
|
495
|
+
width: 100%;
|
|
496
|
+
justify-content: center;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.btn-danger {
|
|
500
|
+
background: #fef2f2;
|
|
501
|
+
color: #dc2626;
|
|
502
|
+
border: 1px solid #fecaca;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.btn-danger:hover {
|
|
506
|
+
background: #fecaca;
|
|
507
|
+
border-color: #f87171;
|
|
508
|
+
}
|
|
509
|
+
</style>
|