Skip to content

Commit 384c4de

Browse files
committed
fix(extensions-agui): update condition check for StringBuilder length
1 parent 194e969 commit 384c4de

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • agentscope-extensions/agentscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter

agentscope-extensions/agentscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/AguiAgentAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,14 @@ private String extractToolResultText(ToolResultBlock toolResult) {
325325
StringBuilder sb = new StringBuilder();
326326
for (ContentBlock output : toolResult.getOutput()) {
327327
if (output instanceof TextBlock textBlock) {
328-
if (sb.length() > 0) {
328+
if (!sb.isEmpty()) {
329329
sb.append("\n");
330330
}
331331
sb.append(textBlock.getText());
332332
}
333333
}
334334

335-
return sb.length() > 0 ? sb.toString() : null;
335+
return !sb.isEmpty() ? sb.toString() : null;
336336
}
337337

338338
/**

0 commit comments

Comments
 (0)