Class SystemOneDecisionAutoConfiguration
Auto-configuration of the System One decision model: a
SystemOneClient from the spring.ai.systemone connection properties and
a SystemOneDecisionModel over it. Either bean backs off to one the application
defines.
The client is created only when spring.ai.systemone.api-key is configured, so
an application that defines a decision model over a client of its own needs no key.
Without a key and without a client of the application, the decision model fails at
startup and names the property.
The spring.ai.systemone.decision.model property is applied only when it is set.
Unset, the decision model uses the default model of the client, so a client the
application defines is asked for the model it was built with.
The client sends through the RestClient.Builder of the application when there
is one, so that customizers, proxies and SSL bundles apply. A configured read timeout
is applied on top of the application's HttpClientSettings; unset, the
application's transport is used as is. Applying it builds the request factory again,
which replaces one that a customizer installed on the builder. Without a builder, the
client builds its own transport.
- Since:
- 2.1.0
- Author:
- Christian Tzolov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsystemOneClient(SystemOneConnectionProperties connectionProperties, SystemOneDecisionProperties decisionProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.web.client.RestClient.Builder> restClientBuilder, org.springframework.beans.factory.ObjectProvider<org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder<?>> requestFactoryBuilder, org.springframework.beans.factory.ObjectProvider<org.springframework.boot.http.client.HttpClientSettings> httpClientSettings) systemOneDecisionModel(org.springframework.beans.factory.ObjectProvider<SystemOneClient> systemOneClient, SystemOneDecisionProperties decisionProperties, org.springframework.beans.factory.ObjectProvider<io.micrometer.observation.ObservationRegistry> observationRegistry, org.springframework.beans.factory.ObjectProvider<DecisionModelObservationConvention> observationConvention)
-
Constructor Details
-
SystemOneDecisionAutoConfiguration
public SystemOneDecisionAutoConfiguration()
-
-
Method Details
-
systemOneClient
@Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix="spring.ai.systemone", name="api-key") public SystemOneClient systemOneClient(SystemOneConnectionProperties connectionProperties, SystemOneDecisionProperties decisionProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.web.client.RestClient.Builder> restClientBuilder, org.springframework.beans.factory.ObjectProvider<org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder<?>> requestFactoryBuilder, org.springframework.beans.factory.ObjectProvider<org.springframework.boot.http.client.HttpClientSettings> httpClientSettings) -
systemOneDecisionModel
@Bean @ConditionalOnMissingBean public SystemOneDecisionModel systemOneDecisionModel(org.springframework.beans.factory.ObjectProvider<SystemOneClient> systemOneClient, SystemOneDecisionProperties decisionProperties, org.springframework.beans.factory.ObjectProvider<io.micrometer.observation.ObservationRegistry> observationRegistry, org.springframework.beans.factory.ObjectProvider<DecisionModelObservationConvention> observationConvention)
-