Skip to content

Dependency on spring-boot-starter-web should be transitive or specified #524

Closed
@jottinger

Description

@jottinger

I created a new Spring AI project using the Spring Initializr, including spring-shell-starter and spring-ai-openai-spring-boot-starter. After adding an OpenAI key, I get a failure on running a simple test that injects a ChatClient:

Parameter 2 of method openAiChatClient in org.springframework.ai.autoconfigure.openai.OpenAiAutoConfiguration required a bean of type 'org.springframework.web.client.RestClient$Builder' that could not be found.

And if I run the application (ignoring the tests):

Web application could not be started as there was no org.springframework.boot.web.reactive.server.ReactiveWebServerFactory

This is trivially repaired by adding a dependency on spring-boot-starter-web (and certainly has other solutions, too, because you don't HAVE to use the starter to get these classes) but it's not clearly indicated in the Spring AI documentation, and I'd expect the Initializr project to include those dependencies itself as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions