chore: Bump version to 1.6.12 and refactor JsonAgentResponseHandler to improve response handling

This commit is contained in:
extio-de
2025-09-22 13:10:08 +02:00
parent 7c467fd5b4
commit d17286a7f4
2 changed files with 2 additions and 2 deletions

View File

@@ -58,9 +58,9 @@ public class JsonAgentResponseHandler implements AgentResponseHandler {
public boolean handle(final Completion completion, final AgentContext context) {
final int firstCurly = completion.response().indexOf("{");
final int lastCurly = completion.response().lastIndexOf("}");
final var response = completion.response().substring(firstCurly, lastCurly + 1);
JsonNode jsonNode;
try {
final var response = completion.response().substring(firstCurly, lastCurly + 1);
jsonNode = this.objectMapper.readTree(response);
}
catch (final Exception e) {