Skip to content

Build a function call without input parameter in spring AI #860

@showpune

Description

@showpune

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions