Skip to content

Commit 54da813

Browse files
committed
fix: use isBlank() instead of trim().isEmpty() to correctly handle unicode whitespace in JdbcChatMemoryRepository
Signed-off-by: astor-dev <orangnlp@gmail.com>
1 parent 18eda40 commit 54da813

File tree

1 file changed

+1
-1
lines changed
  • memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc

1 file changed

+1
-1
lines changed

memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public Message mapRow(ResultSet rs, int i) throws SQLException {
157157
case USER -> new UserMessage(content);
158158
case ASSISTANT -> {
159159
List<AssistantMessage.ToolCall> toolCalls = List.of();
160-
if (toolCallsJson != null && !toolCallsJson.trim().isEmpty()) {
160+
if (toolCallsJson != null && !toolCallsJson.isBlank()) {
161161
try {
162162
toolCalls = ModelOptionsUtils.OBJECT_MAPPER.readValue(toolCallsJson,
163163
ModelOptionsUtils.OBJECT_MAPPER.getTypeFactory()

0 commit comments

Comments
 (0)