diff --git a/main/manager-api/src/main/java/xiaozhi/common/constant/Constant.java b/main/manager-api/src/main/java/xiaozhi/common/constant/Constant.java index 8a9e4fba..b438fec1 100644 --- a/main/manager-api/src/main/java/xiaozhi/common/constant/Constant.java +++ b/main/manager-api/src/main/java/xiaozhi/common/constant/Constant.java @@ -151,6 +151,11 @@ public interface Constant { */ String MEMORY_NO_MEM = "Memory_nomem"; + /** + * 仅上报聊天记录(不总结记忆) + */ + String MEMORY_MEM_REPORT_ONLY = "Memory_mem_report_only"; + /** * 火山引擎双声道语音克隆 */ diff --git a/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentChatSummaryServiceImpl.java b/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentChatSummaryServiceImpl.java index 38fef94b..26e601ec 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentChatSummaryServiceImpl.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentChatSummaryServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import lombok.RequiredArgsConstructor; +import xiaozhi.common.constant.Constant; import xiaozhi.modules.agent.dto.AgentChatHistoryDTO; import xiaozhi.modules.agent.dto.AgentChatSummaryDTO; import xiaozhi.modules.agent.dto.AgentMemoryDTO; @@ -90,21 +91,28 @@ public class AgentChatSummaryServiceImpl implements AgentChatSummaryService { @Override public boolean generateAndSaveChatSummary(String sessionId) { try { - // 1. 生成总结 - AgentChatSummaryDTO summaryDTO = generateChatSummary(sessionId); - if (!summaryDTO.isSuccess()) { - log.info("生成总结失败: {}", summaryDTO.getErrorMessage()); - return false; - } - - // 2. 获取设备信息(通过会话关联的设备) + // 1. 获取设备信息(通过会话关联的设备) DeviceEntity device = getDeviceBySessionId(sessionId); if (device == null) { log.info("未找到与会话 {} 关联的设备", sessionId); return false; } - // 3. 更新智能体记忆 + // 2. 检查记忆模型类型,如果是仅上报聊天记录模式则跳过总结 + String memModelId = agentService.getAgentById(device.getAgentId()).getMemModelId(); + if (memModelId != null && memModelId.equals(Constant.MEMORY_MEM_REPORT_ONLY)) { + log.info("会话 {} 使用仅上报聊天记录模式,跳过记忆总结", sessionId); + return true; + } + + // 3. 生成总结 + AgentChatSummaryDTO summaryDTO = generateChatSummary(sessionId); + if (!summaryDTO.isSuccess()) { + log.info("生成总结失败: {}", summaryDTO.getErrorMessage()); + return false; + } + + // 4. 更新智能体记忆 AgentMemoryDTO memoryDTO = new AgentMemoryDTO(); memoryDTO.setSummaryMemory(summaryDTO.getSummary()); diff --git a/main/manager-api/src/main/java/xiaozhi/modules/model/service/impl/ModelConfigServiceImpl.java b/main/manager-api/src/main/java/xiaozhi/modules/model/service/impl/ModelConfigServiceImpl.java index 24bdb751..a49ce69c 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/model/service/impl/ModelConfigServiceImpl.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/model/service/impl/ModelConfigServiceImpl.java @@ -57,7 +57,8 @@ public class ModelConfigServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("model_type", StringUtils.isBlank(modelType) ? "" : modelType); + queryWrapper.orderByAsc("sort"); List providerEntities = modelProviderDao.selectList(queryWrapper); return ConvertUtils.sourceToTarget(providerEntities, ModelProviderDTO.class); } @@ -147,7 +148,8 @@ public class ModelProviderServiceImpl extends BaseServiceImpl { @@ -1059,4 +1060,13 @@ onMounted(async () => { background: transparent !important; } } +::v-deep .custom-sheet-tts { + .wd-action-sheet { + padding: 8px 0 !important; + overflow: hidden; + } + .wd-action-sheet__actions { + padding: 0 !important; + } +} diff --git a/main/manager-mobile/src/pages/agent/tools.vue b/main/manager-mobile/src/pages/agent/tools.vue index ab0b595b..fb47deae 100644 --- a/main/manager-mobile/src/pages/agent/tools.vue +++ b/main/manager-mobile/src/pages/agent/tools.vue @@ -311,7 +311,7 @@ onMounted(async () => { v-if="notSelectedList.length === 0" class="h-[400rpx] flex items-center justify-center" > - + { v-if="selectedList.length === 0" class="h-[400rpx] flex items-center justify-center" > - + { @@ -586,3 +586,9 @@ onMounted(async () => { + + diff --git a/main/manager-mobile/src/pages/login/index.vue b/main/manager-mobile/src/pages/login/index.vue index 4a83d710..adaf5fb3 100644 --- a/main/manager-mobile/src/pages/login/index.vue +++ b/main/manager-mobile/src/pages/login/index.vue @@ -15,7 +15,7 @@ import { computed, onMounted, ref } from 'vue' import { login } from '@/api/auth' // 导入国际化相关功能 import { changeLanguage, getCurrentLanguage, getSupportedLanguages, initI18n, t } from '@/i18n' -import { useConfigStore } from '@/store' +import { useConfigStore, useUserStore } from '@/store' // 导入SM2加密工具 import { getEnvBaseUrl, sm2Encrypt } from '@/utils' import { toast } from '@/utils/toast' @@ -61,6 +61,7 @@ const loginType = ref<'username' | 'mobile'>('username') // 获取配置store const configStore = useConfigStore() +const userStore = useUserStore() // 区号选择相关 const showAreaCodeSheet = ref(false) @@ -227,6 +228,7 @@ async function handleLogin() { const response = await login(loginData) // 存储token uni.setStorageSync('token', JSON.stringify(response)) + await userStore.getUserInfo() toast.success(t('message.loginSuccess')) @@ -581,7 +583,6 @@ onMounted(async () => { .input-wrapper { position: relative; - background: #f8f9fa; border-radius: 16rpx; padding: 20rpx 16rpx; border: 2rpx solid #e9ecef; diff --git a/main/manager-mobile/src/pages/voiceprint/index.vue b/main/manager-mobile/src/pages/voiceprint/index.vue index e0917c98..a00711a5 100644 --- a/main/manager-mobile/src/pages/voiceprint/index.vue +++ b/main/manager-mobile/src/pages/voiceprint/index.vue @@ -460,8 +460,11 @@ defineExpose({ - - * {{ t('voiceprint.voiceVector') }} + + + * + + {{ t('voiceprint.voiceVector') }} - - * {{ t('voiceprint.name') }} + + + * + + {{ t('voiceprint.name') }} - - * {{ t('voiceprint.description') }} + + + * + + {{ t('voiceprint.description') }}