Hello Spring AI Team,
I'm currently implementing the TokenTextSplitter class and I appreciate the built in flexibility with the builder pattern.
I've noticed though that the inner configuration values chunkSize, minChunkSizeChars, and maxNumChunks are private and inaccessible after the object is constructed. It would be good to introspect or log the splitter configuration after building in some scenarios (e.g., logging, debugging, doing custom validation, or wrapping the behavior). Feature recommendation: * Add public getters to TokenTextSplitter for the inner config fields. or * Provide a method Map getConfig() to obtain them. Is there some design reason why this was avoided? Thank you as always for your work on Spring AI!
— Roua
Comment From: sunyuhan1998
Hi @matoussi-roua I'm just a little bit curious, the built-in properties that you listed are generally specified externally through a Builder
or Constructor
, so I think you know what the values of these properties are, so could you give me some more specific examples of scenarios where you would need to get the values of these built-in properties through a getter
after constructing a TokenTextSplitter
object? I think it would also be beneficial for the Spring AI team to evaluate your requirements.