Skip to content

Commit 09d6305

Browse files
committed
* Bring old RDP (2024ish) implementation into new API and new UI
1 parent c1510fc commit 09d6305

File tree

114 files changed

+13293
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+13293
-112
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ api/node
6060
.generated/
6161
# Ignore Generated keys if they exist
6262
docker/dev-certs/sentrius-ca.crt
63-
docker/dev-certs/sentrius-ca.key
63+
docker/dev-certs/sentrius-ca.key
64+
docker/*/dev-certs/sentrius-ca.crt

.local.env

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
SENTRIUS_VERSION=1.1.411
2-
SENTRIUS_SSH_VERSION=1.1.41
3-
SENTRIUS_KEYCLOAK_VERSION=1.1.53
4-
SENTRIUS_AGENT_VERSION=1.1.42
5-
SENTRIUS_AI_AGENT_VERSION=1.1.284
6-
LLMPROXY_VERSION=1.0.84
7-
LAUNCHER_VERSION=1.0.88
8-
AGENTPROXY_VERSION=1.0.85
9-
SSHPROXY_VERSION=1.0.88
1+
SENTRIUS_VERSION=1.1.507
2+
SENTRIUS_SSH_VERSION=1.1.45
3+
SENTRIUS_KEYCLOAK_VERSION=1.1.60
4+
SENTRIUS_AGENT_VERSION=1.1.51
5+
SENTRIUS_AI_AGENT_VERSION=1.1.287
6+
LLMPROXY_VERSION=1.0.88
7+
LAUNCHER_VERSION=1.0.91
8+
AGENTPROXY_VERSION=1.0.92
9+
SSHPROXY_VERSION=1.0.91
10+
RDPPROXY_VERSION=1.0.121

.local.env.bak

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
SENTRIUS_VERSION=1.1.411
2-
SENTRIUS_SSH_VERSION=1.1.41
3-
SENTRIUS_KEYCLOAK_VERSION=1.1.53
4-
SENTRIUS_AGENT_VERSION=1.1.42
5-
SENTRIUS_AI_AGENT_VERSION=1.1.284
6-
LLMPROXY_VERSION=1.0.84
7-
LAUNCHER_VERSION=1.0.88
8-
AGENTPROXY_VERSION=1.0.85
9-
SSHPROXY_VERSION=1.0.88
1+
SENTRIUS_VERSION=1.1.507
2+
SENTRIUS_SSH_VERSION=1.1.45
3+
SENTRIUS_KEYCLOAK_VERSION=1.1.60
4+
SENTRIUS_AGENT_VERSION=1.1.51
5+
SENTRIUS_AI_AGENT_VERSION=1.1.287
6+
LLMPROXY_VERSION=1.0.88
7+
LAUNCHER_VERSION=1.0.91
8+
AGENTPROXY_VERSION=1.0.92
9+
SSHPROXY_VERSION=1.0.91
10+
RDPPROXY_VERSION=1.0.121

ai-agent/src/main/java/io/sentrius/agent/analysis/agents/verbs/AgentVerbs.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public ArrayNode promptAgent(AgentExecution execution, AgentExecutionContextDTO
139139
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
140140
//log.info("Response is {}", resp);
141141
for (Response.Choice choice : response.getChoices()) {
142-
var content = choice.getMessage().getContent();
142+
var content = choice.getMessage().getContentAsString();
143143
if (content.startsWith("```json")) {
144144
content = content.substring(7, content.length() - 3);
145145
} else if (content.startsWith("```")) {
@@ -250,7 +250,7 @@ public String justifyAgent(
250250
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
251251
//log.info("Response is {}", resp);
252252
for (Response.Choice choice : response.getChoices()) {
253-
var content = choice.getMessage().getContent();
253+
var content = choice.getMessage().getContentAsString();
254254
if (content.startsWith("```json")) {
255255
content = content.substring(7, content.length() - 3);
256256
}
@@ -328,7 +328,7 @@ public List<AssessedTerminal> assessData(AgentExecution execution, AgentExecutio
328328
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
329329
//log.info("Response is {}", resp);
330330
for (Response.Choice choice : response.getChoices()) {
331-
var content = choice.getMessage().getContent();
331+
var content = choice.getMessage().getContentAsString();
332332
if (content.startsWith("```json")) {
333333
content = content.substring(7, content.length() - 3);
334334
}
@@ -363,7 +363,7 @@ public List<AssessedTerminal> assessData(AgentExecution execution, AgentExecutio
363363
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
364364
//log.info("Response is {}", resp);
365365
for (Response.Choice choice : response.getChoices()) {
366-
var content = choice.getMessage().getContent();
366+
var content = choice.getMessage().getContentAsString();
367367
if (content.startsWith("```json")) {
368368
content = content.substring(7, content.length() - 3);
369369
}
@@ -494,7 +494,7 @@ public List<ZtatAsessment> analyzeAtatRequests(AgentExecution execution, List<At
494494
}
495495
var choice = response.getChoices().get(0);
496496

497-
var content = choice.getMessage().getContent();
497+
var content = choice.getMessage().getContentAsString();
498498
if (content.startsWith("```json")) {
499499
content = content.substring(7, content.length() - 3);
500500
}
@@ -558,7 +558,7 @@ public List<ZtatAsessment> analyzeAtatRequests(AgentExecution execution, List<At
558558
}
559559
choice = response.getChoices().get(0);
560560

561-
content = choice.getMessage().getContent();
561+
content = choice.getMessage().getContentAsString();
562562
if (content.startsWith("```json")) {
563563
content = content.substring(7, content.length() - 3);
564564
}
@@ -638,7 +638,7 @@ public AgentContextDTO createAgentContext(AgentExecution execution, AgentExecuti
638638
// log.info("Response is {}", resp);
639639
ArrayNode endpointsLikeList = JsonUtil.MAPPER.createArrayNode();
640640
for (Response.Choice choice : response.getChoices()) {
641-
var content = choice.getMessage().getContent();
641+
var content = choice.getMessage().getContentAsString();
642642
if (content.startsWith("```json")) {
643643
content = content.substring(7, content.length() - 3);
644644
} else if (content.startsWith("```")) {
@@ -713,7 +713,7 @@ public JsonNode getAgentExecutionStatus(AgentExecution execution, AgentExecution
713713
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
714714
//log.info("Response is {}", resp);
715715
for (Response.Choice choice : response.getChoices()) {
716-
var content = choice.getMessage().getContent();
716+
var content = choice.getMessage().getContentAsString();
717717
if (content.startsWith("```json")) {
718718
content = content.substring(7, content.length() - 3);
719719
} else if (content.startsWith("```")) {

ai-agent/src/main/java/io/sentrius/agent/analysis/agents/verbs/ChatVerbs.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ public LLMResponse interpretUserData(
106106
"terminal output if needed " +
107107
"for clarity of the next LLM request and for the user. Ensure your all future responses meets this " +
108108
"json format (LLMResponse format): " + terminalResponse).build());
109-
messages.add(Message.builder().role("user").content(userMessage.getContent()).build());
109+
messages.add(Message.builder().role("user").content(userMessage.getContentAsString()).build());
110110
LLMRequest chatRequest = LLMRequest.builder().model("gpt-4o-mini").messages(messages).build();
111111
var resp = llmService.askQuestion(execution, chatRequest);
112112
executionContext.addMessages( messages );
113113
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
114114
log.info("Response is {}", resp);
115115
for (Response.Choice choice : response.getChoices()) {
116-
var content = choice.getMessage().getContent();
116+
var content = choice.getMessage().getContentAsString();
117117
if (content.startsWith("```json")) {
118118
content = content.substring(7, content.length() - 3);
119119
} else if (content.startsWith("```")) {
@@ -152,15 +152,15 @@ public LLMResponse interpretUserData(
152152
messages.addAll(history);
153153

154154
executionContext.addMessages( userMessage );
155-
messages.add(Message.builder().role("user").content(userMessage.getContent()).build());
155+
messages.add(Message.builder().role("user").content(userMessage.getContentAsString()).build());
156156

157157
LLMRequest chatRequest = LLMRequest.builder().model("gpt-4o-mini").messages(messages).build();
158158
var resp = llmService.askQuestion(execution, chatRequest);
159159

160160
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
161161
log.info("Response is {}", resp);
162162
for (Response.Choice choice : response.getChoices()) {
163-
var content = choice.getMessage().getContent();
163+
var content = choice.getMessage().getContentAsString();
164164
if (content.startsWith("```json")) {
165165
content = content.substring(7, content.length() - 3);
166166
} else if (content.startsWith("```")) {
@@ -230,7 +230,7 @@ public LLMResponse promptAgent(
230230
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
231231
log.info("Response is {}", resp);
232232
for (Response.Choice choice : response.getChoices()) {
233-
var content = choice.getMessage().getContent();
233+
var content = choice.getMessage().getContentAsString();
234234
if (content.startsWith("```json")) {
235235
content = content.substring(7, content.length() - 3);
236236
} else if (content.startsWith("```")) {
@@ -300,7 +300,10 @@ public List<Message> getContextWindow(List<Message> allMessages, int maxContextS
300300
private int getMessageSize(Message msg) {
301301
int size = 0;
302302
if (msg.role != null) size += msg.role.length();
303-
if (msg.content != null) size += msg.content.length();
303+
if (msg.content != null) {
304+
String contentStr = msg.getContentAsString();
305+
if (contentStr != null) size += contentStr.length();
306+
}
304307
if (msg.refusal != null) size += msg.refusal.length();
305308
return size;
306309
}
@@ -365,7 +368,7 @@ public LLMResponse interpret_plan_response(
365368
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
366369
log.info("Response is {}", resp);
367370
for (Response.Choice choice : response.getChoices()) {
368-
var content = choice.getMessage().getContent();
371+
var content = choice.getMessage().getContentAsString();
369372
executionContext.addMessages(choice.getMessage());
370373
if (content.startsWith("```json")) {
371374
content = content.substring(7, content.length() - 3);

0 commit comments

Comments
 (0)