mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-17 04:37:53 +00:00
update
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-06-05 10:02:51
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-02-26 15:38:06
|
||||
* @LastEditTime: 2025-02-26 17:59:42
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -33,11 +33,11 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
public class RobotLlm {
|
||||
|
||||
@Value("${spring.ai.ollama.chat.options.model:qwen2.5:1.5b}")
|
||||
private static String defaultModel;
|
||||
// @Value("${spring.ai.ollama.chat.options.model:qwen2.5:1.5b}")
|
||||
// private static String defaultModel;
|
||||
|
||||
@Value("${spring.ai.ollama.embedding.options.model:qwen2.5:1.5b}")
|
||||
private static String defaultEmbeddingModel;
|
||||
// @Value("${spring.ai.ollama.embedding.options.model:qwen2.5:1.5b}")
|
||||
// private static String defaultEmbeddingModel;
|
||||
|
||||
// 默认启用llm问答
|
||||
@Builder.Default
|
||||
@@ -54,18 +54,18 @@ public class RobotLlm {
|
||||
|
||||
@Builder.Default
|
||||
@Column(name = "llm_provider")
|
||||
// private String provider = "zhipu";
|
||||
private String provider = "ollama";
|
||||
private String provider = "zhipu";
|
||||
// private String provider = "ollama";
|
||||
|
||||
@Builder.Default
|
||||
@Column(name = "llm_model")
|
||||
// private String model = "glm-4-flash";
|
||||
private String model = defaultModel;
|
||||
private String model = "glm-4-flash";
|
||||
// private String model = defaultModel;
|
||||
|
||||
@Builder.Default
|
||||
@Column(name = "llm_embedding_model")
|
||||
// private String embedding = "m3e_base";
|
||||
private String embeddingModel = defaultEmbeddingModel;
|
||||
private String embedding = "embedding-v2";
|
||||
// private String embeddingModel = defaultEmbeddingModel;
|
||||
|
||||
@Builder.Default
|
||||
@Column(name = "llm_temperature")
|
||||
@@ -77,8 +77,8 @@ public class RobotLlm {
|
||||
|
||||
@Builder.Default
|
||||
@Column(name = "llm_prompt", columnDefinition = TypeConsts.COLUMN_TYPE_TEXT)
|
||||
// private String prompt = I18Consts.I18N_ROBOT_LLM_PROMPT;
|
||||
private String prompt = "";
|
||||
private String prompt = I18Consts.I18N_ROBOT_LLM_PROMPT;
|
||||
// private String prompt = "";
|
||||
// private String promptTemplate =
|
||||
// "请根据上下文信息回答问题:\n\n上下文信息:\n{context}\n\n问题:{question}\n\n答案:";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:44:41
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-02-26 17:40:12
|
||||
* @LastEditTime: 2025-02-26 18:06:50
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -155,7 +155,7 @@ public class RobotRestService extends BaseRestService<RobotEntity, RobotRequest,
|
||||
robot.setNickname(request.getNickname());
|
||||
robot.setType(request.getType());
|
||||
robot.setOrgUid(request.getOrgUid());
|
||||
robot.setKbEnabled(request.getIsKbEnabled());
|
||||
// robot.setKbEnabled(request.getIsKbEnabled());
|
||||
robot.setKbUid(request.getKbUid());
|
||||
//
|
||||
// Set common settings
|
||||
@@ -246,7 +246,7 @@ public class RobotRestService extends BaseRestService<RobotEntity, RobotRequest,
|
||||
robot.setDescription(request.getDescription());
|
||||
robot.setPublished(request.getPublished());
|
||||
robot.setDefaultReply(request.getDefaultReply());
|
||||
robot.setKbEnabled(request.getIsKbEnabled());
|
||||
// robot.setKbEnabled(request.getIsKbEnabled());
|
||||
robot.setKbUid(request.getKbUid());
|
||||
//
|
||||
// Set common settings
|
||||
@@ -357,7 +357,12 @@ public class RobotRestService extends BaseRestService<RobotEntity, RobotRequest,
|
||||
}
|
||||
|
||||
// Set LLM
|
||||
robot.setLlm(request.getLlm());
|
||||
if (request.getLlm() == null) {
|
||||
RobotLlm robotLlm = RobotLlm.builder().build();
|
||||
robot.setLlm(robotLlm);
|
||||
} else {
|
||||
robot.setLlm(request.getLlm());
|
||||
}
|
||||
}
|
||||
|
||||
// update avatar
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 22:25:47
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-02-26 15:37:58
|
||||
* @LastEditTime: 2025-02-26 18:00:34
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -91,9 +91,8 @@ public class I18Consts {
|
||||
public static final String I18N_ROBOT_NAME = I18N_PREFIX + "robot.name";
|
||||
public static final String I18N_ROBOT_DESCRIPTION = I18N_PREFIX + "robot.description";
|
||||
public static final String I18N_ROBOT_AGENT_ASSISTANT_NICKNAME = I18N_PREFIX + "robot.agent.assistant.nickname";
|
||||
// public static final String I18N_ROBOT_LLM_PROMPT = I18N_PREFIX +
|
||||
// "llm.prompt";
|
||||
// public static final String I18N_ROBOT_LLM_PROMPT = "角色:资深客服专家; 背景:有专业客服经验,对教育、电商、金融领域有深刻理解; 任务:根据上下文中提到的内容,对提出的问题给出有用、详细、礼貌的回答; 要求:1. 解决客户提出的问题,2. 安抚客户情绪,3. 提升客户满意度";
|
||||
public static final String I18N_ROBOT_LLM_PROMPT = "角色:资深客服专家; 背景:有专业客服经验,对教育、电商、金融领域有深刻理解; 任务:根据上下文中提到的内容,对提出的问题给出有用、详细、礼貌的回答; 要求:1. 解决客户提出的问题,2. 安抚客户情绪,3. 提升客户满意度";
|
||||
public static final String I18N_ROBOT_REPLY = I18N_PREFIX + "robot.reply";
|
||||
public static final String I18N_ROBOT_NO_REPLY = I18N_PREFIX + "robot.noreply";
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user