Commit e8815fb3 authored by alex yao's avatar alex yao

feat:修改开场白AI生成流程

parent c90bc2be
......@@ -177,16 +177,17 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
private static String buildPreambleConfigSystem(String configSystem, String agentTitle, String agentDesc, String agentSystem) {
//若 name desc prompt 都为空,传入默认参数 name 入参 智能问答机器人 desc 随时为你解答问题
if (StringUtils.isBlank(configSystem) && StringUtils.isBlank(agentTitle) && StringUtils.isBlank(agentDesc)) {
return configSystem.replace("${agent_name}", "智能问答机器人").replace("${agent_desc}", " 随时为你解答问题");
return configSystem.replace("${agent_title}", "智能问答机器人").replace("${agent_desc}", " 随时为你解答问题");
}
//若 name desc 其中一项不为空则入参 不传入prompt
if (StringUtils.isNotBlank(agentTitle) || (StringUtils.isNotBlank(agentDesc))) {
return configSystem.replace("${agent_title}", agentTitle).replace("${agent_desc}", agentDesc);
return configSystem.replace("${agent_title}", StringUtils.isNotBlank(agentTitle) ? agentTitle : StringUtils.EMPTY)
.replace("${agent_desc}", StringUtils.isNotBlank(agentDesc) ? agentDesc : StringUtils.EMPTY);
}
// 若 name desc 都空 prompt 有内容,则把prompt 传入desc
if (StringUtils.isNotBlank(agentSystem)) {
return configSystem.replace("${agent_desc}", agentSystem).replace("${agent_name}", "智能问答机器人");
return configSystem.replace("${agent_desc}", agentSystem).replace("${agent_title}", "智能问答机器人");
}
return configSystem;
}
......
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