Record Class PilotConfiguration

java.lang.Object
java.lang.Record
com.shaft.pilot.config.PilotConfiguration
Record Components:
enabled - whether AI execution is enabled
provider - selected provider identifier
approvalPolicy - global approval policy
telemetryEnabled - whether optional external telemetry is enabled
timeout - maximum provider timeout
maxRequestBytes - maximum serialized request size
maxInputTokens - maximum estimated input tokens
maxOutputTokens - maximum output tokens
maxCostUsd - maximum accepted provider-reported cost
retryMaxAttempts - maximum execution attempts
maxConcurrency - maximum concurrent calls per provider
circuitBreakerFailureThreshold - failures before opening the circuit
circuitBreakerCooldown - circuit-open cooldown
redactionPolicy - effective redaction policy
providers - provider-specific endpoint, model, and credential-source configuration

public record PilotConfiguration(boolean enabled, String provider, ApprovalPolicy approvalPolicy, boolean telemetryEnabled, Duration timeout, int maxRequestBytes, long maxInputTokens, long maxOutputTokens, BigDecimal maxCostUsd, int retryMaxAttempts, int maxConcurrency, int circuitBreakerFailureThreshold, Duration circuitBreakerCooldown, RedactionPolicy redactionPolicy, Map<String, ProviderConfiguration> providers) extends Record
Immutable snapshot of effective current-thread Pilot configuration.
  • Constructor Details

    • PilotConfiguration

      public PilotConfiguration(boolean enabled, String provider, ApprovalPolicy approvalPolicy, boolean telemetryEnabled, Duration timeout, int maxRequestBytes, long maxInputTokens, long maxOutputTokens, BigDecimal maxCostUsd, int retryMaxAttempts, int maxConcurrency, int circuitBreakerFailureThreshold, Duration circuitBreakerCooldown, RedactionPolicy redactionPolicy, Map<String, ProviderConfiguration> providers)
      Creates an instance of a PilotConfiguration record class.
      Parameters:
      enabled - the value for the enabled record component
      provider - the value for the provider record component
      approvalPolicy - the value for the approvalPolicy record component
      telemetryEnabled - the value for the telemetryEnabled record component
      timeout - the value for the timeout record component
      maxRequestBytes - the value for the maxRequestBytes record component
      maxInputTokens - the value for the maxInputTokens record component
      maxOutputTokens - the value for the maxOutputTokens record component
      maxCostUsd - the value for the maxCostUsd record component
      retryMaxAttempts - the value for the retryMaxAttempts record component
      maxConcurrency - the value for the maxConcurrency record component
      circuitBreakerFailureThreshold - the value for the circuitBreakerFailureThreshold record component
      circuitBreakerCooldown - the value for the circuitBreakerCooldown record component
      redactionPolicy - the value for the redactionPolicy record component
      providers - the value for the providers record component
  • Method Details

    • current

      public static PilotConfiguration current()
      Reads a current-thread configuration snapshot through SHAFT.Properties.
      Returns:
      effective configuration
    • provider

      public ProviderConfiguration provider(String providerId)
      Returns configuration for a provider.
      Parameters:
      providerId - provider identifier
      Returns:
      provider configuration
      Throws:
      IllegalArgumentException - when the provider is unknown
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • provider

      public String provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component
    • approvalPolicy

      public ApprovalPolicy approvalPolicy()
      Returns the value of the approvalPolicy record component.
      Returns:
      the value of the approvalPolicy record component
    • telemetryEnabled

      public boolean telemetryEnabled()
      Returns the value of the telemetryEnabled record component.
      Returns:
      the value of the telemetryEnabled record component
    • timeout

      public Duration timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • maxRequestBytes

      public int maxRequestBytes()
      Returns the value of the maxRequestBytes record component.
      Returns:
      the value of the maxRequestBytes record component
    • maxInputTokens

      public long maxInputTokens()
      Returns the value of the maxInputTokens record component.
      Returns:
      the value of the maxInputTokens record component
    • maxOutputTokens

      public long maxOutputTokens()
      Returns the value of the maxOutputTokens record component.
      Returns:
      the value of the maxOutputTokens record component
    • maxCostUsd

      public BigDecimal maxCostUsd()
      Returns the value of the maxCostUsd record component.
      Returns:
      the value of the maxCostUsd record component
    • retryMaxAttempts

      public int retryMaxAttempts()
      Returns the value of the retryMaxAttempts record component.
      Returns:
      the value of the retryMaxAttempts record component
    • maxConcurrency

      public int maxConcurrency()
      Returns the value of the maxConcurrency record component.
      Returns:
      the value of the maxConcurrency record component
    • circuitBreakerFailureThreshold

      public int circuitBreakerFailureThreshold()
      Returns the value of the circuitBreakerFailureThreshold record component.
      Returns:
      the value of the circuitBreakerFailureThreshold record component
    • circuitBreakerCooldown

      public Duration circuitBreakerCooldown()
      Returns the value of the circuitBreakerCooldown record component.
      Returns:
      the value of the circuitBreakerCooldown record component
    • redactionPolicy

      public RedactionPolicy redactionPolicy()
      Returns the value of the redactionPolicy record component.
      Returns:
      the value of the redactionPolicy record component
    • providers

      public Map<String, ProviderConfiguration> providers()
      Returns the value of the providers record component.
      Returns:
      the value of the providers record component