+ v-model="form.langCode" maxlength="1000"/>
当前记忆(每次对话后重新生成)
-
-
{{ form.systemPrompt.length }}/1000
+
{{ form.langCode.length }}/1000
@@ -127,20 +126,42 @@ export default {
{ value: '选项2', label: '双皮奶' }
],
models: [
- { label: '大语言模型(LLM)', key: 'llm' },
- { label: '语音识别(ASR)', key: 'asr' },
- { label: '语音活动检测模型(VAD)', key: 'vad' },
- { label: '语音合成模型(TTS)', key: 'tts' },
- { label: '意图识别模型(Intent)', key: 'intent' },
- { label: '记忆模型(Memory)', key: 'memory' }
+ { label: '大语言模型(LLM)', key: 'llmModelId' },
+ { label: '语音识别(ASR)', key: 'asrModelId' },
+ { label: '语音活动检测模型(VAD)', key: 'vadModelId' },
+ { label: '语音合成模型(TTS)', key: 'ttsModelId' },
+ { label: '意图识别模型(Intent)', key: 'intentModelId' },
+ { label: '记忆模型(Memory)', key: 'memModelId' }
],
templates: ['台湾女友', '土豆子', '英语老师', '好奇小男孩', '汪汪队队长']
}
},
methods: {
saveConfig() {
- // 此处写保存配置逻辑
- this.$message.success('配置已保存')
+ const configData = {
+ agentCode: this.form.agentCode,
+ agentName: this.form.agentName,
+ asrModelId: this.form.model.asrModelId,
+ vadModelId: this.form.model.vadModelId,
+ llmModelId: this.form.model.llmModelId,
+ ttsModelId: this.form.model.ttsModelId,
+ ttsVoiceId: this.form.ttsVoiceId,
+ memModelId: this.form.model.memModelId,
+ intentModelId: this.form.model.intentModelId,
+ systemPrompt: this.form.systemPrompt,
+ langCode: this.form.langCode,
+ language: this.form.language,
+ sort: this.form.sort
+ };
+ import('@/apis/module/user').then(({ default: userApi }) => {
+ userApi.updateAgentConfig(this.$route.query.agentId, configData, ({data}) => {
+ if (data.code === 0) {
+ this.$message.success('配置保存成功');
+ } else {
+ this.$message.error(data.msg || '配置保存失败');
+ }
+ });
+ });
},
resetConfig() {
this.$confirm('确定要重置配置吗?', '提示', {
@@ -174,28 +195,33 @@ export default {
this.form.name = template;
this.$message.success(`已选择模板:${template}`);
},
- fetchAgentConfig(agentId) {
- import('@/apis/module/user').then(({ default: userApi }) => {
- userApi.getDeviceConfig(agentId, ({ data }) => {
- if (data.code === 0) {
- this.form = {
- ...this.form,
- ...data.data,
- model: {
- ttsModelId: data.data.ttsModelId,
- vadModelId: data.data.vadModelId,
- asrModelId: data.data.asrModelId,
- llmModelId: data.data.llmModelId,
- memModelId: data.data.memModelId,
- intentModelId: data.data.intentModelId
- }
- };
- } else {
- this.$message.error(data.msg || '获取配置失败');
- }
+ fetchAgentConfig(agentId) {
+ import('@/apis/module/user').then(({ default: userApi }) => {
+ userApi.getDeviceConfig(agentId, ({ data }) => {
+ if (data.code === 0) {
+ this.form = {
+ ...this.form,
+ ...data.data,
+ model: {
+ ttsModelId: data.data.ttsModelId,
+ vadModelId: data.data.vadModelId,
+ asrModelId: data.data.asrModelId,
+ llmModelId: data.data.llmModelId,
+ memModelId: data.data.memModelId,
+ intentModelId: data.data.intentModelId
+ }
+ };
+ } else {
+ this.$message.error(data.msg || '获取配置失败');
+ }
+ });
});
- });
- }
+ },
+ // 清空记忆体内容
+ clearMemory() {
+ this.form.langCode = "";
+ this.$message.success("记忆体已清空");
+ },
},
mounted() {
const agentId = this.$route.query.agentId;
From e9348f5512226bc4fa7b84d25acc2a7e7de08630 Mon Sep 17 00:00:00 2001
From: CGD <3030332422@qq.com>
Date: Tue, 25 Mar 2025 00:01:13 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E2=80=9D?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=99=BA=E8=83=BD=E4=BD=93=E2=80=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
main/manager-web/src/apis/module/user.js | 5 ++-
main/manager-web/src/views/roleConfig.vue | 44 +++++++++++------------
2 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/main/manager-web/src/apis/module/user.js b/main/manager-web/src/apis/module/user.js
index ddec6f04..314c00a3 100755
--- a/main/manager-web/src/apis/module/user.js
+++ b/main/manager-web/src/apis/module/user.js
@@ -221,7 +221,7 @@ export default {
});
}).send();
},
- // 智能体配置
+ // 配置智能体
updateAgentConfig(agentId, configData, callback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/api/v1/user/agent/${agentId}`)
@@ -231,8 +231,7 @@ export default {
RequestService.clearRequestTime();
callback(res);
})
- .fail((err) => {
- console.error('保存配置失败:', err);
+ .fail(() => {
RequestService.reAjaxFun(() => {
this.updateAgentConfig(agentId, configData, callback);
});
diff --git a/main/manager-web/src/views/roleConfig.vue b/main/manager-web/src/views/roleConfig.vue
index e8fd0ade..adf8bedf 100644
--- a/main/manager-web/src/views/roleConfig.vue
+++ b/main/manager-web/src/views/roleConfig.vue
@@ -51,10 +51,10 @@
-
+
当前记忆(每次对话后重新生成)
-
+
清除
@@ -139,28 +139,28 @@ export default {
methods: {
saveConfig() {
const configData = {
- agentCode: this.form.agentCode,
- agentName: this.form.agentName,
- asrModelId: this.form.model.asrModelId,
- vadModelId: this.form.model.vadModelId,
- llmModelId: this.form.model.llmModelId,
- ttsModelId: this.form.model.ttsModelId,
- ttsVoiceId: this.form.ttsVoiceId,
- memModelId: this.form.model.memModelId,
- intentModelId: this.form.model.intentModelId,
- systemPrompt: this.form.systemPrompt,
- langCode: this.form.langCode,
- language: this.form.language,
- sort: this.form.sort
+ agentCode: this.form.agentCode,
+ agentName: this.form.agentName,
+ asrModelId: this.form.model.asrModelId,
+ vadModelId: this.form.model.vadModelId,
+ llmModelId: this.form.model.llmModelId,
+ ttsModelId: this.form.model.ttsModelId,
+ ttsVoiceId: this.form.ttsVoiceId,
+ memModelId: this.form.model.memModelId,
+ intentModelId: this.form.model.intentModelId,
+ systemPrompt: this.form.systemPrompt,
+ langCode: this.form.langCode,
+ language: this.form.language,
+ sort: this.form.sort
};
import('@/apis/module/user').then(({ default: userApi }) => {
- userApi.updateAgentConfig(this.$route.query.agentId, configData, ({data}) => {
- if (data.code === 0) {
- this.$message.success('配置保存成功');
- } else {
- this.$message.error(data.msg || '配置保存失败');
- }
- });
+ userApi.updateAgentConfig(this.$route.query.agentId, configData, ({data}) => {
+ if (data.code === 0) {
+ this.$message.success('配置保存成功');
+ } else {
+ this.$message.error(data.msg || '配置保存失败');
+ }
+ });
});
},
resetConfig() {