|
@@ -239,7 +239,8 @@ public class AiChatMessageServiceImpl implements AiChatMessageService {
|
|
String apiKey = DictFrameworkUtils.parseDictDataValue("ai_key", "多轮对话");
|
|
String apiKey = DictFrameworkUtils.parseDictDataValue("ai_key", "多轮对话");
|
|
JSONObject requestBody = new JSONObject();
|
|
JSONObject requestBody = new JSONObject();
|
|
String kcb = "";
|
|
String kcb = "";
|
|
- if (StrUtil.isNotBlank(conversation.getDifyConversationId())) {
|
|
|
|
|
|
+ if (StrUtil.isNotBlank(conversation.getDifyConversationId()) && !StrUtil.equals("0",
|
|
|
|
+ conversation.getDifyConversationId())) {
|
|
requestBody.set("conversation_id", conversation.getDifyConversationId());
|
|
requestBody.set("conversation_id", conversation.getDifyConversationId());
|
|
} else {
|
|
} else {
|
|
kcb = getKcb(apiKey);
|
|
kcb = getKcb(apiKey);
|
|
@@ -302,7 +303,7 @@ public class AiChatMessageServiceImpl implements AiChatMessageService {
|
|
userId, conversation.getRoleId(), MessageType.ASSISTANT, kcb, sendReqVO.getUseContext(),
|
|
userId, conversation.getRoleId(), MessageType.ASSISTANT, kcb, sendReqVO.getUseContext(),
|
|
knowledgeSegments, sendReqVO.getContentType(), sendReqVO.getStateId());
|
|
knowledgeSegments, sendReqVO.getContentType(), sendReqVO.getStateId());
|
|
|
|
|
|
- if (StrUtil.isBlank(conversation.getDifyConversationId()) && StrUtil.equals(conversation.getDifyConversationId(), "0")) {
|
|
|
|
|
|
+ if (StrUtil.isBlank(conversation.getDifyConversationId())) {
|
|
AiChatMessageSendRespVO.Message rs = BeanUtils.toBean(assistantMessage,
|
|
AiChatMessageSendRespVO.Message rs = BeanUtils.toBean(assistantMessage,
|
|
AiChatMessageSendRespVO.Message.class);
|
|
AiChatMessageSendRespVO.Message.class);
|
|
rs.setDifyConversationId("0");
|
|
rs.setDifyConversationId("0");
|