@@ -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 ("```" )) {
0 commit comments