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

@@ -4,7 +4,7 @@
<artifactId>lm-lib</artifactId> <artifactId>lm-lib</artifactId>
<groupId>de.extio</groupId> <groupId>de.extio</groupId>
<name>lm-lib</name> <name>lm-lib</name>
<version>1.6.11</version> <version>1.6.12</version>
<properties> <properties>
<java.version>21</java.version> <java.version>21</java.version>

View File

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