Commit d53dd999 authored by alex yao's avatar alex yao

feat: agent应用对话新增 系统语言判断

parent a4cbaab1
...@@ -32,6 +32,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.LongMemory; ...@@ -32,6 +32,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.LongMemory;
import cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.AgentLongMemoryEntity; import cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.AgentLongMemoryEntity;
import cn.com.poc.thirdparty.resource.demand.ai.function.memory_variable_writer.MemoryVariableWriter; import cn.com.poc.thirdparty.resource.demand.ai.function.memory_variable_writer.MemoryVariableWriter;
import cn.com.poc.thirdparty.service.LLMService; import cn.com.poc.thirdparty.service.LLMService;
import cn.com.yict.framemax.core.context.Context;
import cn.com.yict.framemax.core.i18n.I18nMessageException; import cn.com.yict.framemax.core.i18n.I18nMessageException;
import cn.com.yict.framemax.data.model.PagingInfo; import cn.com.yict.framemax.data.model.PagingInfo;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
...@@ -522,6 +523,9 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ ...@@ -522,6 +523,9 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
*/ */
private String buildDialogsPrompt(FunctionResult functionResult, List<Message> messages, String agentSystem, Integer[] kdIds, Tool[] tools, String dialogueId, String agentId) { private String buildDialogsPrompt(FunctionResult functionResult, List<Message> messages, String agentSystem, Integer[] kdIds, Tool[] tools, String dialogueId, String agentId) {
String promptTemplate = bizAgentApplicationGcConfigService.getByConfigCode(AgentApplicationGCConfigConstants.AGENT_BASE_SYSTEM).getConfigSystem(); String promptTemplate = bizAgentApplicationGcConfigService.getByConfigCode(AgentApplicationGCConfigConstants.AGENT_BASE_SYSTEM).getConfigSystem();
Locale currentLocale = Context.get().getMessageSource().getCurrentLocale();
// 系统语言
promptTemplate = promptTemplate.replace("${language}", currentLocale.toLanguageTag());
// 应用角色指令 // 应用角色指令
promptTemplate = promptTemplate.replace("${agentSystem}", StringUtils.isNotBlank(agentSystem) ? agentSystem : StringUtils.EMPTY); promptTemplate = promptTemplate.replace("${agentSystem}", StringUtils.isNotBlank(agentSystem) ? agentSystem : StringUtils.EMPTY);
// 调用知识库 // 调用知识库
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment