|
@@ -39,6 +39,7 @@ public class ChatServiceImpl implements ChatService {
|
|
|
try {
|
|
try {
|
|
|
String url = difyProperties.getBaseUrl() + "chat-messages";
|
|
String url = difyProperties.getBaseUrl() + "chat-messages";
|
|
|
String body = JacksonHolder.OBJECT_MAPPER.writeValueAsString(chatDTO);
|
|
String body = JacksonHolder.OBJECT_MAPPER.writeValueAsString(chatDTO);
|
|
|
|
|
+ body = body.replace("responseMode","response_mode").replace("conversationId","conversation_id");
|
|
|
Result<Object> result = httpService.post(url, null, "Bearer " + chatDTO.getAppId(), body, new TypeReference<>() {});
|
|
Result<Object> result = httpService.post(url, null, "Bearer " + chatDTO.getAppId(), body, new TypeReference<>() {});
|
|
|
|
|
|
|
|
if (result.isSuccess() && result.getResult() != null) {
|
|
if (result.isSuccess() && result.getResult() != null) {
|
|
@@ -55,6 +56,7 @@ public class ChatServiceImpl implements ChatService {
|
|
|
try {
|
|
try {
|
|
|
String url = difyProperties.getBaseUrl() + "chat-messages";
|
|
String url = difyProperties.getBaseUrl() + "chat-messages";
|
|
|
String body = JacksonHolder.OBJECT_MAPPER.writeValueAsString(chatDTO);
|
|
String body = JacksonHolder.OBJECT_MAPPER.writeValueAsString(chatDTO);
|
|
|
|
|
+ body = body.replace("responseMode","response_mode").replace("conversationId","conversation_id");
|
|
|
Result<Object> result = httpService.post(url, null, "Bearer " + chatDTO.getAppId(), body, new TypeReference<>() {
|
|
Result<Object> result = httpService.post(url, null, "Bearer " + chatDTO.getAppId(), body, new TypeReference<>() {
|
|
|
});
|
|
});
|
|
|
if (result.isSuccess() && result.getResult() != null) {
|
|
if (result.isSuccess() && result.getResult() != null) {
|