TASK:机器人接口;

This commit is contained in:
shahaibo
2024-01-10 10:48:48 +08:00
parent ef6c8e85cb
commit 39367f5fb7

View File

@@ -79,6 +79,10 @@ public class ChatRobotServiceImpl implements ChatRobotService {
private final ExecutorService executorService = Executors.newSingleThreadExecutor();
Integer timeout = 99999999;
@Value("${access.python.ip:''}")
private String accessPythonIp;
@Value("${access.python.port:''}")
private String accessPythonPort;
@Override
@Transactional(rollbackFor = Exception.class)
public ChatRobotVO sendMessageToChatRobot(ChatSendDTO chatSendDTO) {
@@ -142,7 +146,7 @@ public class ChatRobotServiceImpl implements ChatRobotService {
RequestBody body = RequestBody.create(mediaType, param);
Request request = new Request.Builder()
// .url("http://127.0.0.1:5000/api/chat_stream_test")
.url("http://18.167.251.121:9991/api/chat_stream_test")
.url(accessPythonIp + ":" + accessPythonPort + "/api/chat_stream_test")
// .url(accessPythonIp + ":10200/aifda/api/v1.0/generate")
.method("POST", body)
.addHeader("Content-Type", "application/json")