Record Class DecisionModelProvider.SystemOne

Object
Record
akka.javasdk.decision.DecisionModelProvider.SystemOne
Record Components:
apiKey - the API key, sent as a bearer token. A call without an API key fails.
modelName - the model name, for example jev-latest. Pin a model version once you have tuned your thresholds, because an alias such as jev-latest can move to a new version.
baseUrl - the base URL of the API
connectionTimeout - fail the request when connecting takes longer than this
responseTimeout - fail the request when the answer takes longer than this. The timeout applies to each attempt.
maxRetries - if the request fails with a rate limit, a server error, a timeout or a connection failure, retry this many times
additionalModelRequestHeaders - HTTP headers added to each request
All Implemented Interfaces:
DecisionModelProvider
Enclosing interface:
DecisionModelProvider

public static record DecisionModelProvider.SystemOne(String apiKey, String modelName, String baseUrl, Duration connectionTimeout, Duration responseTimeout, int maxRetries, List<akka.http.javadsl.model.HttpHeader> additionalModelRequestHeaders) extends Record implements DecisionModelProvider
A model that implements the SystemOne API. The request goes to /v1/systemone under the base URL.
  • Constructor Details

    • SystemOne

      public SystemOne(String apiKey, String modelName, String baseUrl, Duration connectionTimeout, Duration responseTimeout, int maxRetries, List<akka.http.javadsl.model.HttpHeader> additionalModelRequestHeaders)
      Creates an instance of a SystemOne record class.
      Parameters:
      apiKey - the value for the apiKey record component
      modelName - the value for the modelName record component
      baseUrl - the value for the baseUrl record component
      connectionTimeout - the value for the connectionTimeout record component
      responseTimeout - the value for the responseTimeout record component
      maxRetries - the value for the maxRetries record component
      additionalModelRequestHeaders - the value for the additionalModelRequestHeaders record component
  • Method Details

    • fromConfig

      public static DecisionModelProvider.SystemOne fromConfig(com.typesafe.config.Config config)
      Read the provider from a configuration section such as system-one.
    • withApiKey

      public DecisionModelProvider.SystemOne withApiKey(String apiKey)
    • withModelName

      public DecisionModelProvider.SystemOne withModelName(String modelName)
    • withBaseUrl

      public DecisionModelProvider.SystemOne withBaseUrl(String baseUrl)
    • withConnectionTimeout

      public DecisionModelProvider.SystemOne withConnectionTimeout(Duration connectionTimeout)
    • withResponseTimeout

      public DecisionModelProvider.SystemOne withResponseTimeout(Duration responseTimeout)
    • withMaxRetries

      public DecisionModelProvider.SystemOne withMaxRetries(int maxRetries)
    • withAdditionalModelRequestHeaders

      public DecisionModelProvider.SystemOne withAdditionalModelRequestHeaders(List<akka.http.javadsl.model.HttpHeader> headers)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • apiKey

      public String apiKey()
      Returns the value of the apiKey record component.
      Returns:
      the value of the apiKey record component
    • modelName

      public String modelName()
      Returns the value of the modelName record component.
      Returns:
      the value of the modelName record component
    • baseUrl

      public String baseUrl()
      Returns the value of the baseUrl record component.
      Returns:
      the value of the baseUrl record component
    • connectionTimeout

      public Duration connectionTimeout()
      Returns the value of the connectionTimeout record component.
      Returns:
      the value of the connectionTimeout record component
    • responseTimeout

      public Duration responseTimeout()
      Returns the value of the responseTimeout record component.
      Returns:
      the value of the responseTimeout record component
    • maxRetries

      public int maxRetries()
      Returns the value of the maxRetries record component.
      Returns:
      the value of the maxRetries record component
    • additionalModelRequestHeaders

      public List<akka.http.javadsl.model.HttpHeader> additionalModelRequestHeaders()
      Returns the value of the additionalModelRequestHeaders record component.
      Returns:
      the value of the additionalModelRequestHeaders record component