Bug description The FunctionInvokingFunctionCallback and MethodInvokingFunctionCallback classes have package-scoped constructors, meaning that it's not possible to instantiate them outside their package. As a consequence, the only way to get instances is via Reflection or via the DefaultFunctionCallbackBuilder. Among the other things, this issue impacts custom implementations of FunctionCallback.Builder.

Environment Spring AI: 1.0.0-SNAPSHOT Java: 23

Expected behavior The FunctionInvokingFunctionCallback and MethodInvokingFunctionCallback classes can be instantiated outside their package.

Minimal Complete Reproducible example See the consequence of this issue here, where Reflection had to be used to instantiate FunctionInvokingFunctionCallback (example) and MethodInvokingFunctionCallback (example).

Comment From: ThomasVitale

Superseded by https://github.com/spring-projects/spring-ai/pull/2064 and https://github.com/spring-projects/spring-ai/pull/2085