Merge pull request #1175 from ljwwd2/main

聊天记录支持配置
This commit is contained in:
hrz
2025-05-11 19:06:27 +08:00
committed by GitHub
8 changed files with 108 additions and 19 deletions
+3 -3
View File
@@ -50,9 +50,9 @@ export default {
}).send();
},
// 获取智能体配置
getDeviceConfig(deviceId, callback) {
getDeviceConfig(agentId, callback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/agent/${deviceId}`)
.url(`${getServiceUrl()}/agent/${agentId}`)
.method('GET')
.success((res) => {
RequestService.clearRequestTime();
@@ -61,7 +61,7 @@ export default {
.fail((err) => {
console.error('获取配置失败:', err);
RequestService.reAjaxFun(() => {
this.getDeviceConfig(deviceId, callback);
this.getDeviceConfig(agentId, callback);
});
}).send();
},
+29 -1
View File
@@ -65,12 +65,18 @@
:key="`option-${index}-${optionIndex}`" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="角色音色">
<el-form-item label="角色音色">
<el-select v-model="form.ttsVoiceId" placeholder="请选择" class="form-select">
<el-option v-for="(item, index) in voiceOptions" :key="`voice-${index}`" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="聊天记录配置">
<el-select v-model="form.chatHistoryConf" placeholder="请选择" class="form-select">
<el-option v-for="(item, index) in chatHistoryOptions" :key="`chatHistoryConf-${index}`" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</div>
</div>
</div>
@@ -96,6 +102,7 @@ export default {
agentCode: "",
agentName: "",
ttsVoiceId: "",
chatHistoryConf: "",
systemPrompt: "",
langCode: "",
language: "",
@@ -121,6 +128,24 @@ export default {
templates: [],
loadingTemplate: false,
voiceOptions: [],
chatHistoryOptions: [
{
"value": 0,
"label": "不记录"
},
{
"value": 1,
"label": "仅记录文本"
},
{
"value": 2,
"label": "仅记录语音"
},
{
"value": 3,
"label": "文本音频都记录"
}
],
}
},
methods: {
@@ -136,6 +161,7 @@ export default {
llmModelId: this.form.model.llmModelId,
ttsModelId: this.form.model.ttsModelId,
ttsVoiceId: this.form.ttsVoiceId,
chatHistoryConf: this.form.chatHistoryConf,
memModelId: this.form.model.memModelId,
intentModelId: this.form.model.intentModelId,
systemPrompt: this.form.systemPrompt,
@@ -167,6 +193,7 @@ export default {
agentCode: "",
agentName: "",
ttsVoiceId: "",
chatHistoryConf: "",
systemPrompt: "",
langCode: "",
language: "",
@@ -220,6 +247,7 @@ export default {
...this.form,
agentName: templateData.agentName || this.form.agentName,
ttsVoiceId: templateData.ttsVoiceId || this.form.ttsVoiceId,
chatHistoryConf: templateData.chatHistoryConf || this.form.chatHistoryConf,
systemPrompt: templateData.systemPrompt || this.form.systemPrompt,
langCode: templateData.langCode || this.form.langCode,
model: {