Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ api/node
.generated/
# Ignore Generated keys if they exist
docker/dev-certs/sentrius-ca.crt
docker/dev-certs/sentrius-ca.key
docker/dev-certs/sentrius-ca.key
docker/*/dev-certs/sentrius-ca.crt
19 changes: 10 additions & 9 deletions .local.env
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
SENTRIUS_VERSION=1.1.411
SENTRIUS_SSH_VERSION=1.1.41
SENTRIUS_KEYCLOAK_VERSION=1.1.53
SENTRIUS_AGENT_VERSION=1.1.42
SENTRIUS_AI_AGENT_VERSION=1.1.284
LLMPROXY_VERSION=1.0.84
LAUNCHER_VERSION=1.0.88
AGENTPROXY_VERSION=1.0.85
SSHPROXY_VERSION=1.0.88
SENTRIUS_VERSION=1.1.507
SENTRIUS_SSH_VERSION=1.1.45
SENTRIUS_KEYCLOAK_VERSION=1.1.60
SENTRIUS_AGENT_VERSION=1.1.51
SENTRIUS_AI_AGENT_VERSION=1.1.287
LLMPROXY_VERSION=1.0.88
LAUNCHER_VERSION=1.0.91
AGENTPROXY_VERSION=1.0.92
SSHPROXY_VERSION=1.0.91
RDPPROXY_VERSION=1.0.121
19 changes: 10 additions & 9 deletions .local.env.bak
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
SENTRIUS_VERSION=1.1.411
SENTRIUS_SSH_VERSION=1.1.41
SENTRIUS_KEYCLOAK_VERSION=1.1.53
SENTRIUS_AGENT_VERSION=1.1.42
SENTRIUS_AI_AGENT_VERSION=1.1.284
LLMPROXY_VERSION=1.0.84
LAUNCHER_VERSION=1.0.88
AGENTPROXY_VERSION=1.0.85
SSHPROXY_VERSION=1.0.88
SENTRIUS_VERSION=1.1.507
SENTRIUS_SSH_VERSION=1.1.45
SENTRIUS_KEYCLOAK_VERSION=1.1.60
SENTRIUS_AGENT_VERSION=1.1.51
SENTRIUS_AI_AGENT_VERSION=1.1.287
LLMPROXY_VERSION=1.0.88
LAUNCHER_VERSION=1.0.91
AGENTPROXY_VERSION=1.0.92
SSHPROXY_VERSION=1.0.91
RDPPROXY_VERSION=1.0.121
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public ArrayNode promptAgent(AgentExecution execution, AgentExecutionContextDTO
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
//log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
} else if (content.startsWith("```")) {
Expand Down Expand Up @@ -250,7 +250,7 @@ public String justifyAgent(
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
//log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
}
Expand Down Expand Up @@ -328,7 +328,7 @@ public List<AssessedTerminal> assessData(AgentExecution execution, AgentExecutio
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
//log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
}
Expand Down Expand Up @@ -363,7 +363,7 @@ public List<AssessedTerminal> assessData(AgentExecution execution, AgentExecutio
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
//log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
}
Expand Down Expand Up @@ -494,7 +494,7 @@ public List<ZtatAsessment> analyzeAtatRequests(AgentExecution execution, List<At
}
var choice = response.getChoices().get(0);

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

content = choice.getMessage().getContent();
content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
}
Expand Down Expand Up @@ -638,7 +638,7 @@ public AgentContextDTO createAgentContext(AgentExecution execution, AgentExecuti
// log.info("Response is {}", resp);
ArrayNode endpointsLikeList = JsonUtil.MAPPER.createArrayNode();
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
} else if (content.startsWith("```")) {
Expand Down Expand Up @@ -713,7 +713,7 @@ public JsonNode getAgentExecutionStatus(AgentExecution execution, AgentExecution
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
//log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
} else if (content.startsWith("```")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ public LLMResponse interpretUserData(
"terminal output if needed " +
"for clarity of the next LLM request and for the user. Ensure your all future responses meets this " +
"json format (LLMResponse format): " + terminalResponse).build());
messages.add(Message.builder().role("user").content(userMessage.getContent()).build());
messages.add(Message.builder().role("user").content(userMessage.getContentAsString()).build());
LLMRequest chatRequest = LLMRequest.builder().model("gpt-4o-mini").messages(messages).build();
var resp = llmService.askQuestion(execution, chatRequest);
executionContext.addMessages( messages );
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
} else if (content.startsWith("```")) {
Expand Down Expand Up @@ -152,15 +152,15 @@ public LLMResponse interpretUserData(
messages.addAll(history);

executionContext.addMessages( userMessage );
messages.add(Message.builder().role("user").content(userMessage.getContent()).build());
messages.add(Message.builder().role("user").content(userMessage.getContentAsString()).build());

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

Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
} else if (content.startsWith("```")) {
Expand Down Expand Up @@ -230,7 +230,7 @@ public LLMResponse promptAgent(
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
} else if (content.startsWith("```")) {
Expand Down Expand Up @@ -300,7 +300,10 @@ public List<Message> getContextWindow(List<Message> allMessages, int maxContextS
private int getMessageSize(Message msg) {
int size = 0;
if (msg.role != null) size += msg.role.length();
if (msg.content != null) size += msg.content.length();
if (msg.content != null) {
String contentStr = msg.getContentAsString();
if (contentStr != null) size += contentStr.length();
}
if (msg.refusal != null) size += msg.refusal.length();
return size;
}
Expand Down Expand Up @@ -365,7 +368,7 @@ public LLMResponse interpret_plan_response(
Response response = JsonUtil.MAPPER.readValue(resp, Response.class);
log.info("Response is {}", resp);
for (Response.Choice choice : response.getChoices()) {
var content = choice.getMessage().getContent();
var content = choice.getMessage().getContentAsString();
executionContext.addMessages(choice.getMessage());
if (content.startsWith("```json")) {
content = content.substring(7, content.length() - 3);
Expand Down
Loading
Loading