Commit 6a719e97 authored by alex yao's avatar alex yao

feat: Agent应用,模型配置添加temperature字段

parent 46c7bd0c
...@@ -19,7 +19,7 @@ public interface AgentApplicationInfoService { ...@@ -19,7 +19,7 @@ public interface AgentApplicationInfoService {
* 应用预览 * 应用预览
*/ */
String callAgentApplication(String identifier, String largeModel, String[] unitIds, String agentSystem, String callAgentApplication(String identifier, String largeModel, String[] unitIds, String agentSystem,
Integer[] knowledgeIds, Integer communicationTurn, Float topP, Integer[] knowledgeIds, Integer communicationTurn, Float topP, Float temperature,
List<Message> messages, List<Tool> tools, HttpServletResponse httpServletResponse) throws Exception; List<Message> messages, List<Tool> tools, HttpServletResponse httpServletResponse) throws Exception;
/** /**
......
...@@ -102,7 +102,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ ...@@ -102,7 +102,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
} }
@Override @Override
public String callAgentApplication(String identifier, String largeModel, String[] unitIds, String agentSystem, Integer[] kdIds, Integer communicationTurn, Float topP, List<Message> messages, List<Tool> tools, HttpServletResponse httpServletResponse) throws Exception { public String callAgentApplication(String identifier, String largeModel, String[] unitIds, String agentSystem, Integer[] kdIds, Integer communicationTurn, Float topP, Float temperature, List<Message> messages, List<Tool> tools, HttpServletResponse httpServletResponse) throws Exception {
logger.info("--------- Call Agent Application large model:{},unitIds:{},agentSystem:{},knowledgeIds:{}" + " communicationTurn:{},topP:{},messages:{}--------------", largeModel, unitIds, agentSystem, kdIds, communicationTurn, topP, messages); logger.info("--------- Call Agent Application large model:{},unitIds:{},agentSystem:{},knowledgeIds:{}" + " communicationTurn:{},topP:{},messages:{}--------------", largeModel, unitIds, agentSystem, kdIds, communicationTurn, topP, messages);
String model = modelConvert(largeModel); String model = modelConvert(largeModel);
......
...@@ -58,6 +58,7 @@ public class AgentApplicationInfoConvert { ...@@ -58,6 +58,7 @@ public class AgentApplicationInfoConvert {
} }
entity.setLargeModel(model.getLargeModel()); entity.setLargeModel(model.getLargeModel());
entity.setTopP(model.getTopP()); entity.setTopP(model.getTopP());
entity.setTemperature(model.getTemperature());
if (StringUtils.isNotBlank(model.getUnitIds())) { if (StringUtils.isNotBlank(model.getUnitIds())) {
entity.setUnitIds(JsonUtils.deSerialize(model.getUnitIds(), String[].class)); entity.setUnitIds(JsonUtils.deSerialize(model.getUnitIds(), String[].class));
} }
...@@ -98,6 +99,7 @@ public class AgentApplicationInfoConvert { ...@@ -98,6 +99,7 @@ public class AgentApplicationInfoConvert {
} }
model.setLargeModel(entity.getLargeModel()); model.setLargeModel(entity.getLargeModel());
model.setTopP(entity.getTopP()); model.setTopP(entity.getTopP());
model.setTemperature(entity.getTemperature());
if (ArrayUtils.isNotEmpty(entity.getUnitIds())) { if (ArrayUtils.isNotEmpty(entity.getUnitIds())) {
model.setUnitIds(JsonUtil.toJson(entity.getUnitIds())); model.setUnitIds(JsonUtil.toJson(entity.getUnitIds()));
} }
...@@ -137,6 +139,7 @@ public class AgentApplicationInfoConvert { ...@@ -137,6 +139,7 @@ public class AgentApplicationInfoConvert {
AgentApplicationCommModelConfig commModelConfig = new AgentApplicationCommModelConfig(); AgentApplicationCommModelConfig commModelConfig = new AgentApplicationCommModelConfig();
commModelConfig.setLargeModel(entity.getLargeModel()); commModelConfig.setLargeModel(entity.getLargeModel());
commModelConfig.setTopP(entity.getTopP()); commModelConfig.setTopP(entity.getTopP());
commModelConfig.setTemperature(entity.getTemperature());
commModelConfig.setCommunicationTurn(entity.getCommunicationTurn()); commModelConfig.setCommunicationTurn(entity.getCommunicationTurn());
AgentApplicationInfoDto dto = new AgentApplicationInfoDto(); AgentApplicationInfoDto dto = new AgentApplicationInfoDto();
...@@ -184,6 +187,7 @@ public class AgentApplicationInfoConvert { ...@@ -184,6 +187,7 @@ public class AgentApplicationInfoConvert {
if (ObjectUtil.isNotEmpty(dto.getCommModelConfig())) { if (ObjectUtil.isNotEmpty(dto.getCommModelConfig())) {
entity.setLargeModel(dto.getCommModelConfig().getLargeModel()); entity.setLargeModel(dto.getCommModelConfig().getLargeModel());
entity.setTopP(dto.getCommModelConfig().getTopP()); entity.setTopP(dto.getCommModelConfig().getTopP());
entity.setTemperature(dto.getCommModelConfig().getTemperature());
entity.setCommunicationTurn(dto.getCommModelConfig().getCommunicationTurn()); entity.setCommunicationTurn(dto.getCommModelConfig().getCommunicationTurn());
} }
...@@ -225,6 +229,7 @@ public class AgentApplicationInfoConvert { ...@@ -225,6 +229,7 @@ public class AgentApplicationInfoConvert {
} }
entity.setLargeModel(infoQueryItem.getLargeModel()); entity.setLargeModel(infoQueryItem.getLargeModel());
entity.setTopP(infoQueryItem.getTopP()); entity.setTopP(infoQueryItem.getTopP());
entity.setTemperature(infoQueryItem.getTemperature());
if (StringUtils.isNotBlank(infoQueryItem.getUnitIds())) { if (StringUtils.isNotBlank(infoQueryItem.getUnitIds())) {
entity.setUnitIds(JsonUtils.deSerialize(infoQueryItem.getUnitIds(), String[].class)); entity.setUnitIds(JsonUtils.deSerialize(infoQueryItem.getUnitIds(), String[].class));
} }
......
...@@ -46,6 +46,7 @@ public class BizAgentApplicationPublishConvert { ...@@ -46,6 +46,7 @@ public class BizAgentApplicationPublishConvert {
} }
entity.setLargeModel(model.getLargeModel()); entity.setLargeModel(model.getLargeModel());
entity.setTopP(model.getTopP()); entity.setTopP(model.getTopP());
entity.setTemperature(model.getTemperature());
if (StringUtils.isNotBlank(model.getUnitIds())) { if (StringUtils.isNotBlank(model.getUnitIds())) {
entity.setUnitIds(JsonUtils.deSerialize(model.getUnitIds(), String[].class)); entity.setUnitIds(JsonUtils.deSerialize(model.getUnitIds(), String[].class));
} }
...@@ -84,6 +85,7 @@ public class BizAgentApplicationPublishConvert { ...@@ -84,6 +85,7 @@ public class BizAgentApplicationPublishConvert {
} }
model.setLargeModel(entity.getLargeModel()); model.setLargeModel(entity.getLargeModel());
model.setTopP(entity.getTopP()); model.setTopP(entity.getTopP());
model.setTemperature(entity.getTemperature());
if (ArrayUtils.isNotEmpty(entity.getUnitIds())) { if (ArrayUtils.isNotEmpty(entity.getUnitIds())) {
model.setUnitIds(JsonUtil.toJson(entity.getUnitIds())); model.setUnitIds(JsonUtil.toJson(entity.getUnitIds()));
} }
...@@ -123,6 +125,7 @@ public class BizAgentApplicationPublishConvert { ...@@ -123,6 +125,7 @@ public class BizAgentApplicationPublishConvert {
AgentApplicationCommModelConfig commModelConfig = new AgentApplicationCommModelConfig(); AgentApplicationCommModelConfig commModelConfig = new AgentApplicationCommModelConfig();
commModelConfig.setLargeModel(entity.getLargeModel()); commModelConfig.setLargeModel(entity.getLargeModel());
commModelConfig.setTopP(entity.getTopP()); commModelConfig.setTopP(entity.getTopP());
commModelConfig.setTemperature(entity.getTemperature());
commModelConfig.setCommunicationTurn(entity.getCommunicationTurn()); commModelConfig.setCommunicationTurn(entity.getCommunicationTurn());
dto.setBaseInfo(baseInfo); dto.setBaseInfo(baseInfo);
...@@ -170,6 +173,7 @@ public class BizAgentApplicationPublishConvert { ...@@ -170,6 +173,7 @@ public class BizAgentApplicationPublishConvert {
if (ObjectUtil.isNotEmpty(dto.getCommModelConfig())) { if (ObjectUtil.isNotEmpty(dto.getCommModelConfig())) {
entity.setLargeModel(dto.getCommModelConfig().getLargeModel()); entity.setLargeModel(dto.getCommModelConfig().getLargeModel());
entity.setTopP(dto.getCommModelConfig().getTopP()); entity.setTopP(dto.getCommModelConfig().getTopP());
entity.setTemperature(dto.getCommModelConfig().getTemperature());
} }
entity.setUnitIds(dto.getUnitIds()); entity.setUnitIds(dto.getUnitIds());
......
...@@ -33,6 +33,20 @@ public class AgentApplicationCommModelConfig { ...@@ -33,6 +33,20 @@ public class AgentApplicationCommModelConfig {
this.topP = topP; this.topP = topP;
} }
/**
* temperature
* 对话模型温度配置 (0-1.0]
*/
private Float temperature;
public Float getTemperature() {
return temperature;
}
public void setTemperature(Float temperature) {
this.temperature = temperature;
}
/** /**
* communication_turn * communication_turn
* 对话上下文保存轮次 * 对话上下文保存轮次
......
...@@ -6,332 +6,396 @@ import java.util.Arrays; ...@@ -6,332 +6,396 @@ import java.util.Arrays;
public class BizAgentApplicationInfoEntity { public class BizAgentApplicationInfoEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** id /**
*自增ID * id
*/ * 自增ID
*/
private java.lang.Integer id; private java.lang.Integer id;
public java.lang.Integer getId(){ public java.lang.Integer getId() {
return this.id; return this.id;
} }
public void setId(java.lang.Integer id){ public void setId(java.lang.Integer id) {
this.id = id; this.id = id;
} }
/** member_id
*创建应用的用户ID /**
*/ * member_id
* 创建应用的用户ID
*/
private java.lang.Integer memberId; private java.lang.Integer memberId;
public java.lang.Integer getMemberId(){ public java.lang.Integer getMemberId() {
return this.memberId; return this.memberId;
} }
public void setMemberId(java.lang.Integer memberId){ public void setMemberId(java.lang.Integer memberId) {
this.memberId = memberId; this.memberId = memberId;
} }
/** agent_id
*agent应用ID /**
*/ * agent_id
* agent应用ID
*/
private java.lang.String agentId; private java.lang.String agentId;
public java.lang.String getAgentId(){ public java.lang.String getAgentId() {
return this.agentId; return this.agentId;
} }
public void setAgentId(java.lang.String agentId){ public void setAgentId(java.lang.String agentId) {
this.agentId = agentId; this.agentId = agentId;
} }
/** agent_avatar
*应用头像ICON地址 /**
*/ * agent_avatar
* 应用头像ICON地址
*/
private java.lang.String agentAvatar; private java.lang.String agentAvatar;
public java.lang.String getAgentAvatar(){ public java.lang.String getAgentAvatar() {
return this.agentAvatar; return this.agentAvatar;
} }
public void setAgentAvatar(java.lang.String agentAvatar){ public void setAgentAvatar(java.lang.String agentAvatar) {
this.agentAvatar = agentAvatar; this.agentAvatar = agentAvatar;
} }
/** agent_title
*应用标题 /**
*/ * agent_title
* 应用标题
*/
private java.lang.String agentTitle; private java.lang.String agentTitle;
public java.lang.String getAgentTitle(){ public java.lang.String getAgentTitle() {
return this.agentTitle; return this.agentTitle;
} }
public void setAgentTitle(java.lang.String agentTitle){ public void setAgentTitle(java.lang.String agentTitle) {
this.agentTitle = agentTitle; this.agentTitle = agentTitle;
} }
/** agent_desc
*应用描述 /**
*/ * agent_desc
* 应用描述
*/
private java.lang.String agentDesc; private java.lang.String agentDesc;
public java.lang.String getAgentDesc(){ public java.lang.String getAgentDesc() {
return this.agentDesc; return this.agentDesc;
} }
public void setAgentDesc(java.lang.String agentDesc){ public void setAgentDesc(java.lang.String agentDesc) {
this.agentDesc = agentDesc; this.agentDesc = agentDesc;
} }
/** agent_system
*角色指令 /**
*/ * agent_system
* 角色指令
*/
private java.lang.String agentSystem; private java.lang.String agentSystem;
public java.lang.String getAgentSystem(){ public java.lang.String getAgentSystem() {
return this.agentSystem; return this.agentSystem;
} }
public void setAgentSystem(java.lang.String agentSystem){ public void setAgentSystem(java.lang.String agentSystem) {
this.agentSystem = agentSystem; this.agentSystem = agentSystem;
} }
/** agent_publish_status
*应用发布状态 草稿-draft 发布-publish /**
*/ * agent_publish_status
* 应用发布状态 草稿-draft 发布-publish
*/
private java.lang.String agentPublishStatus; private java.lang.String agentPublishStatus;
public java.lang.String getAgentPublishStatus(){ public java.lang.String getAgentPublishStatus() {
return this.agentPublishStatus; return this.agentPublishStatus;
} }
public void setAgentPublishStatus(java.lang.String agentPublishStatus){ public void setAgentPublishStatus(java.lang.String agentPublishStatus) {
this.agentPublishStatus = agentPublishStatus; this.agentPublishStatus = agentPublishStatus;
} }
/** publish_time
*发布时间 /**
*/ * publish_time
* 发布时间
*/
private java.util.Date publishTime; private java.util.Date publishTime;
public java.util.Date getPublishTime(){ public java.util.Date getPublishTime() {
return this.publishTime; return this.publishTime;
} }
public void setPublishTime(java.util.Date publishTime){ public void setPublishTime(java.util.Date publishTime) {
this.publishTime = publishTime; this.publishTime = publishTime;
} }
/** preamble
*开场白 /**
*/ * preamble
* 开场白
*/
private java.lang.String preamble; private java.lang.String preamble;
public java.lang.String getPreamble(){ public java.lang.String getPreamble() {
return this.preamble; return this.preamble;
} }
public void setPreamble(java.lang.String preamble){ public void setPreamble(java.lang.String preamble) {
this.preamble = preamble; this.preamble = preamble;
} }
/** featured_questions
*推荐问 /**
*/ * featured_questions
* 推荐问
*/
private java.lang.String[] featuredQuestions; private java.lang.String[] featuredQuestions;
public java.lang.String[] getFeaturedQuestions(){ public java.lang.String[] getFeaturedQuestions() {
return this.featuredQuestions; return this.featuredQuestions;
} }
public void setFeaturedQuestions(java.lang.String[] featuredQuestions){ public void setFeaturedQuestions(java.lang.String[] featuredQuestions) {
this.featuredQuestions = featuredQuestions; this.featuredQuestions = featuredQuestions;
} }
/** communication_turn
*对话上下文保存轮次 0-100 /**
*/ * communication_turn
* 对话上下文保存轮次 0-100
*/
private java.lang.Integer communicationTurn; private java.lang.Integer communicationTurn;
public java.lang.Integer getCommunicationTurn(){ public java.lang.Integer getCommunicationTurn() {
return this.communicationTurn; return this.communicationTurn;
} }
public void setCommunicationTurn(java.lang.Integer communicationTurn){ public void setCommunicationTurn(java.lang.Integer communicationTurn) {
this.communicationTurn = communicationTurn; this.communicationTurn = communicationTurn;
} }
/** continuous_question_status
*追问状态 默认-default 自定义-customizable 关闭-close /**
*/ * continuous_question_status
* 追问状态 默认-default 自定义-customizable 关闭-close
*/
private java.lang.String continuousQuestionStatus; private java.lang.String continuousQuestionStatus;
public java.lang.String getContinuousQuestionStatus(){ public java.lang.String getContinuousQuestionStatus() {
return this.continuousQuestionStatus; return this.continuousQuestionStatus;
} }
public void setContinuousQuestionStatus(java.lang.String continuousQuestionStatus){ public void setContinuousQuestionStatus(java.lang.String continuousQuestionStatus) {
this.continuousQuestionStatus = continuousQuestionStatus; this.continuousQuestionStatus = continuousQuestionStatus;
} }
/** continuous_question_system
*追问prompt /**
*/ * continuous_question_system
* 追问prompt
*/
private java.lang.String continuousQuestionSystem; private java.lang.String continuousQuestionSystem;
public java.lang.String getContinuousQuestionSystem(){ public java.lang.String getContinuousQuestionSystem() {
return this.continuousQuestionSystem; return this.continuousQuestionSystem;
} }
public void setContinuousQuestionSystem(java.lang.String continuousQuestionSystem){ public void setContinuousQuestionSystem(java.lang.String continuousQuestionSystem) {
this.continuousQuestionSystem = continuousQuestionSystem; this.continuousQuestionSystem = continuousQuestionSystem;
} }
/** continuous_question_turn
*追问轮次 1-5 /**
*/ * continuous_question_turn
* 追问轮次 1-5
*/
private java.lang.Integer continuousQuestionTurn; private java.lang.Integer continuousQuestionTurn;
public java.lang.Integer getContinuousQuestionTurn(){ public java.lang.Integer getContinuousQuestionTurn() {
return this.continuousQuestionTurn; return this.continuousQuestionTurn;
} }
public void setContinuousQuestionTurn(java.lang.Integer continuousQuestionTurn){ public void setContinuousQuestionTurn(java.lang.Integer continuousQuestionTurn) {
this.continuousQuestionTurn = continuousQuestionTurn; this.continuousQuestionTurn = continuousQuestionTurn;
} }
/** knowledge_ids
*知识库ID /**
*/ * knowledge_ids
* 知识库ID
*/
private java.lang.String[] knowledgeIds; private java.lang.String[] knowledgeIds;
public java.lang.String[] getKnowledgeIds(){ public java.lang.String[] getKnowledgeIds() {
return this.knowledgeIds; return this.knowledgeIds;
} }
public void setKnowledgeIds(java.lang.String[] knowledgeIds){ public void setKnowledgeIds(java.lang.String[] knowledgeIds) {
this.knowledgeIds = knowledgeIds; this.knowledgeIds = knowledgeIds;
} }
/** large_model
*问答模型 /**
*/ * large_model
* 问答模型
*/
private java.lang.String largeModel; private java.lang.String largeModel;
public java.lang.String getLargeModel(){ public java.lang.String getLargeModel() {
return this.largeModel; return this.largeModel;
} }
public void setLargeModel(java.lang.String largeModel){ public void setLargeModel(java.lang.String largeModel) {
this.largeModel = largeModel; this.largeModel = largeModel;
} }
/** top_p
*对话模型 多样性 [0-1.00] /**
*/ * top_p
* 对话模型 多样性 [0-1.00]
*/
private java.lang.Float topP; private java.lang.Float topP;
public java.lang.Float getTopP(){ public java.lang.Float getTopP() {
return this.topP; return this.topP;
} }
public void setTopP(java.lang.Float topP){ public void setTopP(java.lang.Float topP) {
this.topP = topP; this.topP = topP;
} }
/** unit_ids
*组件ID /**
*/ * temperature
* 温度 (0-1.0]
*/
private java.lang.Float temperature;
public Float getTemperature() {
return temperature;
}
public void setTemperature(Float temperature) {
this.temperature = temperature;
}
/**
* unit_ids
* 组件ID
*/
private java.lang.String[] unitIds; private java.lang.String[] unitIds;
public java.lang.String[] getUnitIds(){ public java.lang.String[] getUnitIds() {
return this.unitIds; return this.unitIds;
} }
public void setUnitIds(java.lang.String[] unitIds){ public void setUnitIds(java.lang.String[] unitIds) {
this.unitIds = unitIds; this.unitIds = unitIds;
} }
/** variable_structure /**
*变量结构 * variable_structure
* 变量结构
*/ */
private java.lang.String[] variableStructure; private java.lang.String[] variableStructure;
public java.lang.String[] getVariableStructure(){ public java.lang.String[] getVariableStructure() {
return this.variableStructure; return this.variableStructure;
} }
public void setVariableStructure(java.lang.String[] variableStructure){ public void setVariableStructure(java.lang.String[] variableStructure) {
this.variableStructure = variableStructure; this.variableStructure = variableStructure;
} }
/** is_long_memory /**
*是否开启长期记忆 1、Y 是 2、N 否 * is_long_memory
* 是否开启长期记忆 1、Y 是 2、N 否
*/ */
private java.lang.String isLongMemory; private java.lang.String isLongMemory;
public java.lang.String getIsLongMemory(){ public java.lang.String getIsLongMemory() {
return this.isLongMemory; return this.isLongMemory;
} }
public void setIsLongMemory(java.lang.String isLongMemory){ public void setIsLongMemory(java.lang.String isLongMemory) {
this.isLongMemory = isLongMemory; this.isLongMemory = isLongMemory;
} }
/** is_deleted /**
*是否删除 1、Y 是 2、N 否 * is_deleted
*/ * 是否删除 1、Y 是 2、N 否
*/
private java.lang.String isDeleted; private java.lang.String isDeleted;
public java.lang.String getIsDeleted(){ public java.lang.String getIsDeleted() {
return this.isDeleted; return this.isDeleted;
} }
public void setIsDeleted(java.lang.String isDeleted){ public void setIsDeleted(java.lang.String isDeleted) {
this.isDeleted = isDeleted; this.isDeleted = isDeleted;
} }
/** CREATOR
*创建人 /**
*/ * CREATOR
* 创建人
*/
private java.lang.String creator; private java.lang.String creator;
public java.lang.String getCreator(){ public java.lang.String getCreator() {
return this.creator; return this.creator;
} }
public void setCreator(java.lang.String creator){ public void setCreator(java.lang.String creator) {
this.creator = creator; this.creator = creator;
} }
/** CREATED_TIME
*创建时间 /**
*/ * CREATED_TIME
* 创建时间
*/
private java.util.Date createdTime; private java.util.Date createdTime;
public java.util.Date getCreatedTime(){ public java.util.Date getCreatedTime() {
return this.createdTime; return this.createdTime;
} }
public void setCreatedTime(java.util.Date createdTime){ public void setCreatedTime(java.util.Date createdTime) {
this.createdTime = createdTime; this.createdTime = createdTime;
} }
/** MODIFIER
*修改人 /**
*/ * MODIFIER
* 修改人
*/
private java.lang.String modifier; private java.lang.String modifier;
public java.lang.String getModifier(){ public java.lang.String getModifier() {
return this.modifier; return this.modifier;
} }
public void setModifier(java.lang.String modifier){ public void setModifier(java.lang.String modifier) {
this.modifier = modifier; this.modifier = modifier;
} }
/** MODIFIED_TIME
*修改时间 /**
*/ * MODIFIED_TIME
* 修改时间
*/
private java.util.Date modifiedTime; private java.util.Date modifiedTime;
public java.util.Date getModifiedTime(){ public java.util.Date getModifiedTime() {
return this.modifiedTime; return this.modifiedTime;
} }
public void setModifiedTime(java.util.Date modifiedTime){ public void setModifiedTime(java.util.Date modifiedTime) {
this.modifiedTime = modifiedTime; this.modifiedTime = modifiedTime;
} }
/** SYS_VERSION
*乐观锁,版本号 /**
*/ * SYS_VERSION
* 乐观锁,版本号
*/
private java.lang.Integer sysVersion; private java.lang.Integer sysVersion;
public java.lang.Integer getSysVersion(){ public java.lang.Integer getSysVersion() {
return this.sysVersion; return this.sysVersion;
} }
public void setSysVersion(java.lang.Integer sysVersion){ public void setSysVersion(java.lang.Integer sysVersion) {
this.sysVersion = sysVersion; this.sysVersion = sysVersion;
} }
......
package cn.com.poc.agent_application.entity; package cn.com.poc.agent_application.entity;
import javax.persistence.Column;
public class BizAgentApplicationPublishEntity { public class BizAgentApplicationPublishEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -234,6 +236,22 @@ public class BizAgentApplicationPublishEntity { ...@@ -234,6 +236,22 @@ public class BizAgentApplicationPublishEntity {
public void setTopP(java.lang.Float topP){ public void setTopP(java.lang.Float topP){
this.topP = topP; this.topP = topP;
} }
/** temperature
*对话模型 温度 [0-1.00]
*/
private java.lang.Float temperature;
public java.lang.Float getTemperature(){
return this.temperature;
}
public void setTemperature(java.lang.Float temperature){
this.temperature = temperature;
}
/** unit_ids /** unit_ids
*组件ID *组件ID
*/ */
......
...@@ -312,8 +312,27 @@ public class BizAgentApplicationInfoModel extends BaseModelClass implements Seri ...@@ -312,8 +312,27 @@ public class BizAgentApplicationInfoModel extends BaseModelClass implements Seri
this.topP = topP; this.topP = topP;
super.addValidField("topP"); super.addValidField("topP");
} }
/** temperature
*对话模型 温度 [0-1.00]
*/
private java.lang.Float temperature;
@Column(name = "temperature",length = 12)
public java.lang.Float getTemperature(){
return this.temperature;
}
public void setTemperature(java.lang.Float temperature){
this.temperature = temperature;
super.addValidField("temperature");
}
/** unit_ids /** unit_ids
*组件ID *组件ID
*/ */
......
...@@ -295,8 +295,25 @@ public class BizAgentApplicationPublishModel extends BaseModelClass implements S ...@@ -295,8 +295,25 @@ public class BizAgentApplicationPublishModel extends BaseModelClass implements S
this.topP = topP; this.topP = topP;
super.addValidField("topP"); super.addValidField("topP");
} }
/** temperature
*对话模型 温度 [0-1.00]
*/
private java.lang.Float temperature;
@Column(name = "temperature",length = 12)
public java.lang.Float getTemperature(){
return this.temperature;
}
public void setTemperature(java.lang.Float temperature){
this.temperature = temperature;
super.addValidField("temperature");
}
/** unit_ids /** unit_ids
*组件ID *组件ID
*/ */
......
...@@ -17,6 +17,7 @@ select distinct ...@@ -17,6 +17,7 @@ select distinct
knowledge_ids, knowledge_ids,
large_model, large_model,
top_p, top_p,
temperature,
unit_ids, unit_ids,
variable_structure, variable_structure,
is_long_memory, is_long_memory,
......
...@@ -284,6 +284,23 @@ public class AgentApplicationInfoQueryItem extends BaseItemClass implements Seri ...@@ -284,6 +284,23 @@ public class AgentApplicationInfoQueryItem extends BaseItemClass implements Seri
this.topP = topP; this.topP = topP;
} }
/** temperature
*对话模型 温度 [0-1.00]
*/
private java.lang.Float temperature;
@Column(name = "temperature")
public java.lang.Float getTemperature(){
return this.temperature;
}
public void setTemperature(java.lang.Float temperature){
this.temperature = temperature;
}
/** /**
* unit_ids * unit_ids
* unit_ids * unit_ids
......
...@@ -164,7 +164,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest { ...@@ -164,7 +164,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
//调用应用服务 //调用应用服务
agentApplicationInfoService.callAgentApplication(agentId, infoEntity.getLargeModel(), infoEntity.getUnitIds() agentApplicationInfoService.callAgentApplication(agentId, infoEntity.getLargeModel(), infoEntity.getUnitIds()
, infoEntity.getAgentSystem(), kdIds.toArray(new Integer[0]), infoEntity.getCommunicationTurn(), infoEntity.getTopP() , infoEntity.getAgentSystem(), kdIds.toArray(new Integer[0]), infoEntity.getCommunicationTurn(), infoEntity.getTopP(), infoEntity.getTemperature()
, dto.getMessages(), tools, httpServletResponse); , dto.getMessages(), tools, httpServletResponse);
} catch (Exception e) { } catch (Exception e) {
httpServletResponse.setContentType("text/event-stream"); httpServletResponse.setContentType("text/event-stream");
......
...@@ -189,6 +189,10 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl ...@@ -189,6 +189,10 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl
if (entity.getTopP() != null) { if (entity.getTopP() != null) {
Assert.isTrue(entity.getTopP() >= 0 && entity.getTopP() <= 1.00, "top p is error,must more than 0 and less than 1.0"); Assert.isTrue(entity.getTopP() >= 0 && entity.getTopP() <= 1.00, "top p is error,must more than 0 and less than 1.0");
} }
if (entity.getTemperature() != null) {
Assert.isTrue(entity.getTemperature() > 0 && entity.getTemperature() <= 1.0, "temperature is error,must greater than 0, less than or equal to 1.9");
}
model.setTemperature(entity.getTemperature());
model.setTopP(entity.getTopP()); model.setTopP(entity.getTopP());
model.setContinuousQuestionStatus(entity.getContinuousQuestionStatus()); model.setContinuousQuestionStatus(entity.getContinuousQuestionStatus());
model.setContinuousQuestionSystem(entity.getContinuousQuestionSystem()); model.setContinuousQuestionSystem(entity.getContinuousQuestionSystem());
......
...@@ -40,7 +40,6 @@ import java.util.HashSet; ...@@ -40,7 +40,6 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
@Service @Service
public class AgentApplicationServiceImpl implements AgentApplicationService { public class AgentApplicationServiceImpl implements AgentApplicationService {
...@@ -114,7 +113,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService { ...@@ -114,7 +113,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
String output = agentApplicationInfoService.callAgentApplication(dialogsId, infoEntity.getLargeModel(), String output = agentApplicationInfoService.callAgentApplication(dialogsId, infoEntity.getLargeModel(),
infoEntity.getUnitIds(), infoEntity.getAgentSystem(), kdIdList.toArray(new Integer[0]), infoEntity.getCommunicationTurn(), infoEntity.getUnitIds(), infoEntity.getAgentSystem(), kdIdList.toArray(new Integer[0]), infoEntity.getCommunicationTurn(),
infoEntity.getTopP(), messages, tools, httpServletResponse); infoEntity.getTopP(), infoEntity.getTemperature(), messages, tools, httpServletResponse);
//保存对话记录 //保存对话记录
......
...@@ -2,6 +2,8 @@ package cn.com.poc; ...@@ -2,6 +2,8 @@ package cn.com.poc;
import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService; import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService;
import cn.com.poc.common.service.RedisService;
import cn.com.poc.expose.aggregate.AgentApplicationService;
import cn.com.poc.thirdparty.resource.demand.ai.aggregate.DemandKnowledgeService; import cn.com.poc.thirdparty.resource.demand.ai.aggregate.DemandKnowledgeService;
import cn.com.yict.framemax.core.spring.SingleContextInitializer; import cn.com.yict.framemax.core.spring.SingleContextInitializer;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -30,6 +32,9 @@ public class AgentApplicationInfoTest { ...@@ -30,6 +32,9 @@ public class AgentApplicationInfoTest {
@Resource @Resource
private DemandKnowledgeService demandKnowledgeService; private DemandKnowledgeService demandKnowledgeService;
@Resource
private RedisService redisService;
/** /**
* Agent 应用标题,描述生成 * Agent 应用标题,描述生成
*/ */
...@@ -46,4 +51,19 @@ public class AgentApplicationInfoTest { ...@@ -46,4 +51,19 @@ public class AgentApplicationInfoTest {
System.out.println(list.toString()); System.out.println(list.toString());
} }
@Test
public void test() {
List<Object> list = Lists.newArrayList("1", "2", "3", "4", "5", "6", "7", "8", "9", "1");
redisService.lSet("key",list);
}
@Resource
private AgentApplicationService agentApplicationService;
@Test
public void test2() throws InterruptedException {
agentApplicationService.createRecommendQuestion();
}
} }
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