Open johnsonr opened 2 months ago
Agreed. A first pass was taken and it seems like we will need to refactor some code, going from setters into ctor methods that ensure they are not null. Some passes were taken in the past, but a good deal depends on the internal implementation (e.g we never return null for content from a call, but empty string - or we already get usage stats in headers from openai) so quick passes don't work.
Using Spring AI from Kotlin, it's noticeable that unlike Spring Framework, it doesn't use
@NonNull
annotations, which are appropriate for most parameters and return types.Doing this would not only make Spring AI nicer to use from Kotlin, but make the Java code clearer and more consistent with other Spring projects.