Skip to content

Commit d5d907b

Browse files
ChoHadamilayaperumalg
authored andcommitted
Fix: Initialize TokenTextSplitter Builder fields with default values
Signed-off-by: ChoHadam <hadamcho97@gmail.com>
1 parent e14e788 commit d5d907b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-ai-commons/src/main/java/org/springframework/ai/transformer/splitter/TokenTextSplitter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ private String decodeTokens(List<Integer> tokens) {
154154

155155
public static final class Builder {
156156

157-
private int chunkSize;
157+
private int chunkSize = DEFAULT_CHUNK_SIZE;
158158

159-
private int minChunkSizeChars;
159+
private int minChunkSizeChars = MIN_CHUNK_SIZE_CHARS;
160160

161-
private int minChunkLengthToEmbed;
161+
private int minChunkLengthToEmbed = MIN_CHUNK_LENGTH_TO_EMBED;
162162

163-
private int maxNumChunks;
163+
private int maxNumChunks = MAX_NUM_CHUNKS;
164164

165-
private boolean keepSeparator;
165+
private boolean keepSeparator = KEEP_SEPARATOR;
166166

167167
private Builder() {
168168
}

0 commit comments

Comments
 (0)