Provider Http Clients
The HTTP clients of a model provider that accepts connect-timeout and read-timeout under its own prefix, falling back to embabel.agent.platform.http-client.* for whichever it leaves unset.
A provider normally clones the shared aiModelRestClientBuilder / aiModelWebClientBuilder beans. Those carry the http-client timeouts and cannot be changed, so a provider that sets a timeout of its own (ownsTransport) replaces their transport with its own client. Anything else customised on that transport, such as a proxy or TLS, then does not apply to the provider.
The replacement is reactor-netty, configured as NettyClientAutoConfiguration configures the shared client: read is netty's response timeout, which bounds each wait between reads, so a stream that stalls mid-body fails too. When the application opted out of reactor-netty (reactorNetty false) it is the JDK client instead, whose read bounds only the wait for response headers.
Needs spring-webflux and reactor-netty-http on the classpath, which this module declares as optional.
Properties
Functions
The connector for streamed calls that webClientBuilder installs when the provider ownsTransport. Public so a provider's tests can check which transport it chose.
The request factory for blocking calls that restClientBuilder installs when the provider ownsTransport. Public so a provider's tests can check which transport it chose.
A clone of shared, with this provider's transport when it ownsTransport. When no shared builder is available, a JDK-backed one carrying connect and read, so a slow response is not aborted at the ~10s default a bare reactor-netty request factory would impose.
A clone of shared, with this provider's transport when it ownsTransport. Without a shared builder, a builder whose connector carries the resolved timeouts, as restClientBuilder does for blocking calls, so a streamed call is bounded by the http-client values too.