spring-ai
spring-ai copied to clipboard
Build a function call without input parameter in spring AI
Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create. If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:
Bug description
I tried to define a function call in spring ai as below
@Bean
@Description("return list of Vets, include their specialist")
public Function<Void, Collection<Vet>> queryVets() {
return request -> {
return vetRepository.findAll();
};
}
The input parameter is Void as the function has no input parameter. But I got the error
com.azure.core.exception.HttpResponseException: Status code 400, "{ "error": { "message": "Invalid schema for function 'queryVets': In context=(), object schema missing properties", "type": "invalid_request_error", "param": null, "code": null } } "
Expected behavior If the function input parameter is VOID, there should no such check
Minimal Complete Reproducible example Please provide a failing test or a minimal complete verifiable example that reproduces the issue. Bug reports that are reproducible will take priority in resolution over reports that are not reproducible.