Skip to content

Consistently allow for aiModelWebClientBuilder#1590

Merged
poutsma merged 1 commit intoembabel:mainfrom
poutsma:gh-1584
Apr 10, 2026
Merged

Consistently allow for aiModelWebClientBuilder#1590
poutsma merged 1 commit intoembabel:mainfrom
poutsma:gh-1584

Conversation

@poutsma
Copy link
Copy Markdown
Contributor

@poutsma poutsma commented Apr 9, 2026

This PR ensures that all subclasses of OpenAiCompatibleModelFactory have a webClientBuilder: ObjectProvider<WebClient.Builder> constructor parameter, so that users can configure WebClient (e.g. for OAuth2 or custom authentication) without having to bypass autoconfiguration.

Closes gh-1584

This commit ensures that all subclasses of OpenAiCompatibleModelFactory
have a webClientBuilder: ObjectProvider<WebClient.Builder> constructor
parameter, so that users can configure WebClient (e.g. for OAuth2 or
custom authentication) without having to bypass autoconfiguration.

Closes embabelgh-1584

Signed-off-by: Arjen Poutsma <poutsma@mac.com>
@poutsma poutsma requested review from alexheifetz and johnsonr April 9, 2026 09:38
@poutsma
Copy link
Copy Markdown
Contributor Author

poutsma commented Apr 9, 2026

@alexheifetz I wasn't sure if the aiModelWebClientBuilder bean definition in NettyClientAutoConfiguration is a good idea or not, please advise. It does pull in a webflux dependency.

@alexheifetz
Copy link
Copy Markdown
Contributor

i think having compile dependency on spring-webflux should be OK

Here is why:

  1. Model Providers (via spring-ai) already bring in spring-webflux dependencies into the Maven Reactor
  2. Netty Autocofiguration is an optional addition on top of Model Providers, therefore new dependency on spring-webflux does not really change runtime composition of the application.

@simeshev
Copy link
Copy Markdown
Collaborator

simeshev commented Apr 9, 2026

@poutsma, do we care about Javadocs for public methods?

@poutsma
Copy link
Copy Markdown
Contributor Author

poutsma commented Apr 10, 2026

@poutsma, do we care about Javadocs for public methods?

It depends :). I do care about documentation for public, user-facing API methods, but the changes made in this PR do not fall in that category. The only new public method this PR introduces is a @Bean declaration, which is not meant for user consumption. Moreover, the existing aiModelHttpRequestFactory bean declaration in NettyClientAutoConfiguration did not have documentation either, so for consistency I would have to introduce it for that method as well, thus obscuring the goal of this PR.

@poutsma poutsma merged commit 1c5ff1c into embabel:main Apr 10, 2026
7 checks passed
@poutsma poutsma deleted the gh-1584 branch April 10, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace hardcoded WebClient and RestClient with injected builders

3 participants