chatbot connection

This commit is contained in:
Bane Stojkovic
2025-03-31 23:42:25 +02:00
parent 757ddf3e6d
commit edd0a16079
3 changed files with 73 additions and 3 deletions
@@ -78,9 +78,10 @@ public class ChatbotPresenter {
return service;
}
String promptChatbot() throws NotLoggedInException {
public String promptChatbot(String project, String netlist, String prompt) throws NotLoggedInException {
if (!CloudPresenter.Instance.isLoggedIn())
throw new NotLoggedInException();
return null;
return getService().promptChatbot(CloudPresenter.Instance.getCurrentUsername(), CloudPresenter.Instance.getCurrentToken(),
CloudPresenter.Instance.getMachineId(), project, netlist, prompt);
}
}
@@ -291,6 +291,10 @@ public class CloudPresenter {
return ConfigurationManager.getInstance().readString(USERNAME_KEY, null);
}
public String getCurrentToken() {
return ConfigurationManager.getInstance().readString(TOKEN_KEY, null);
}
public void updatePassword(String oldPassword, String newPassword) throws CloudException {
String username = ConfigurationManager.getInstance().readString(USERNAME_KEY, null);
@@ -416,7 +420,7 @@ public class CloudPresenter {
return properties;
}
private String getMachineId() {
public String getMachineId() {
if (machineId == null) {
try {
InetAddress ip = InetAddress.getLocalHost();