-
Notifications
You must be signed in to change notification settings - Fork 956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The function definition for function calls does not support generics. #1118
Comments
generic type is not supported yet, because the |
|
Hard to tell from the commit as it doesn't contain tests as specified in the example. That said, we have spent efforts to remove dependencies on type utils in spring cloud function and create our own type utils that also help with kotlin support. Will investigate the support of
|
Add support for no-argument Supplier and single-argument Consumer function callbacks in the Spring AI core module. This enhancement allows: - Registration of Supplier<O> callbacks with no input (Void) type - Registration of Consumer<I> callbacks with no output (Void) type - Support for Kotlin Function0 (equivalent to Java Supplier) - Handle empty properties for Void input types in schema generation - Enhance FunctionCallback builder to support Supplier/Consumer patterns Additional changes: - Add test coverage for both Supplier and Consumer callbacks in various scenarios - Enhance TypeResolverHelper to support Consumer input type resolution - Support lambda-style function declarations for improved ergonomics - Add test cases for void input/output handling in OpenAI chat model - Include examples of function calls without return values - Add support for parameterless functions through Supplier interface Resolves spring-projects#1718 , spring-projects#1277 , spring-projects#1118, spring-projects#860
Add support for no-argument Supplier and single-argument Consumer function callbacks in the Spring AI core module. This enhancement allows: - Registration of Supplier<O> callbacks with no input (Void) type - Registration of Consumer<I> callbacks with no output (Void) type - Support for Kotlin Function0 (equivalent to Java Supplier) - Handle empty properties for Void input types in schema generation - Enhance FunctionCallback builder to support Supplier/Consumer patterns Additional changes: - Add test coverage for both Supplier and Consumer callbacks in various scenarios - Enhance TypeResolverHelper to support Consumer input type resolution - Support lambda-style function declarations for improved ergonomics - Add test cases for void input/output handling in OpenAI chat model - Include examples of function calls without return values - Add support for parameterless functions through Supplier interface Resolves spring-projects#1718 , spring-projects#1277 , spring-projects#1118, spring-projects#860
Add support for no-argument Supplier and single-argument Consumer function callbacks in the Spring AI core module. This enhancement allows: - Registration of Supplier<O> callbacks with no input (Void) type - Registration of Consumer<I> callbacks with no output (Void) type - Support for Kotlin Function0 (equivalent to Java Supplier) - Handle empty properties for Void input types in schema generation - Enhance FunctionCallback builder to support Supplier/Consumer patterns Additional changes: - Add test coverage for both Supplier and Consumer callbacks in various scenarios - Enhance TypeResolverHelper to support Consumer input type resolution - Support lambda-style function declarations for improved ergonomics - Add test cases for void input/output handling in OpenAI chat model - Include examples of function calls without return values - Add support for parameterless functions through Supplier interface Add comprehensive documentation for the FunctionCallback API: - Overview of the interface and its key methods - Builder pattern usage with function and method invocation approaches - Examples for different function types (Function, BiFunction, Supplier, Consumer) - Best practices and common pitfalls - Schema generation and customization options Resolves #1718 , #1277 , #1118, #860
Resolved by 432954d |
Add support for no-argument Supplier and single-argument Consumer function callbacks in the Spring AI core module. This enhancement allows: - Registration of Supplier<O> callbacks with no input (Void) type - Registration of Consumer<I> callbacks with no output (Void) type - Support for Kotlin Function0 (equivalent to Java Supplier) - Handle empty properties for Void input types in schema generation - Enhance FunctionCallback builder to support Supplier/Consumer patterns Additional changes: - Add test coverage for both Supplier and Consumer callbacks in various scenarios - Enhance TypeResolverHelper to support Consumer input type resolution - Support lambda-style function declarations for improved ergonomics - Add test cases for void input/output handling in OpenAI chat model - Include examples of function calls without return values - Add support for parameterless functions through Supplier interface Add comprehensive documentation for the FunctionCallback API: - Overview of the interface and its key methods - Builder pattern usage with function and method invocation approaches - Examples for different function types (Function, BiFunction, Supplier, Consumer) - Best practices and common pitfalls - Schema generation and customization options Resolves spring-projects#1718 , spring-projects#1277 , spring-projects#1118, spring-projects#860 Signed-off-by: leijendary <jonathanleijendekker@gmail.com>
Add support for no-argument Supplier and single-argument Consumer function callbacks in the Spring AI core module. This enhancement allows: - Registration of Supplier<O> callbacks with no input (Void) type - Registration of Consumer<I> callbacks with no output (Void) type - Support for Kotlin Function0 (equivalent to Java Supplier) - Handle empty properties for Void input types in schema generation - Enhance FunctionCallback builder to support Supplier/Consumer patterns Additional changes: - Add test coverage for both Supplier and Consumer callbacks in various scenarios - Enhance TypeResolverHelper to support Consumer input type resolution - Support lambda-style function declarations for improved ergonomics - Add test cases for void input/output handling in OpenAI chat model - Include examples of function calls without return values - Add support for parameterless functions through Supplier interface Add comprehensive documentation for the FunctionCallback API: - Overview of the interface and its key methods - Builder pattern usage with function and method invocation approaches - Examples for different function types (Function, BiFunction, Supplier, Consumer) - Best practices and common pitfalls - Schema generation and customization options Resolves spring-projects#1718 , spring-projects#1277 , spring-projects#1118, spring-projects#860 Signed-off-by: leijendary <jonathanleijendekker@gmail.com>
Bug description
The function definition for function calls does not support generics.
Environment
Spring ai 1.0.0-SNAPSHOT
Steps to reproduce
step1:
public class TrainSearchScheduleService implements Function<RequestBean<TrainSearchScheduleReq>, ResponseBean<TrainSearchScheduleResp>> { .... }
step2:
Runtime-based generic type erasure leads to the loss of generic information.
Expected behavior
Support for defining generic classes
The text was updated successfully, but these errors were encountered: