Record Class PilotConfiguration
java.lang.Object
java.lang.Record
com.shaft.pilot.config.PilotConfiguration
- Record Components:
enabled- whether AI execution is enabledprovider- selected provider identifierapprovalPolicy- global approval policytelemetryEnabled- whether optional external telemetry is enabledtimeout- maximum provider timeoutmaxRequestBytes- maximum serialized request sizemaxInputTokens- maximum estimated input tokensmaxOutputTokens- maximum output tokensmaxCostUsd- maximum accepted provider-reported costretryMaxAttempts- maximum execution attemptsmaxConcurrency- maximum concurrent calls per providercircuitBreakerFailureThreshold- failures before opening the circuitcircuitBreakerCooldown- circuit-open cooldownredactionPolicy- effective redaction policyproviders- 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 Summary
ConstructorsConstructorDescriptionPilotConfiguration(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 aPilotConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapprovalPolicyrecord component.Returns the value of thecircuitBreakerCooldownrecord component.intReturns the value of thecircuitBreakerFailureThresholdrecord component.static PilotConfigurationcurrent()Reads a current-thread configuration snapshot throughSHAFT.Properties.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxConcurrencyrecord component.Returns the value of themaxCostUsdrecord component.longReturns the value of themaxInputTokensrecord component.longReturns the value of themaxOutputTokensrecord component.intReturns the value of themaxRequestBytesrecord component.provider()Returns the value of theproviderrecord component.Returns configuration for a provider.Returns the value of theprovidersrecord component.Returns the value of theredactionPolicyrecord component.intReturns the value of theretryMaxAttemptsrecord component.booleanReturns the value of thetelemetryEnabledrecord component.timeout()Returns the value of thetimeoutrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aPilotConfigurationrecord class.- Parameters:
enabled- the value for theenabledrecord componentprovider- the value for theproviderrecord componentapprovalPolicy- the value for theapprovalPolicyrecord componenttelemetryEnabled- the value for thetelemetryEnabledrecord componenttimeout- the value for thetimeoutrecord componentmaxRequestBytes- the value for themaxRequestBytesrecord componentmaxInputTokens- the value for themaxInputTokensrecord componentmaxOutputTokens- the value for themaxOutputTokensrecord componentmaxCostUsd- the value for themaxCostUsdrecord componentretryMaxAttempts- the value for theretryMaxAttemptsrecord componentmaxConcurrency- the value for themaxConcurrencyrecord componentcircuitBreakerFailureThreshold- the value for thecircuitBreakerFailureThresholdrecord componentcircuitBreakerCooldown- the value for thecircuitBreakerCooldownrecord componentredactionPolicy- the value for theredactionPolicyrecord componentproviders- the value for theprovidersrecord component
-
-
Method Details
-
current
Reads a current-thread configuration snapshot throughSHAFT.Properties.- Returns:
- effective configuration
-
provider
Returns configuration for a provider.- Parameters:
providerId- provider identifier- Returns:
- provider configuration
- Throws:
IllegalArgumentException- when the provider is unknown
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
enabled
-
provider
-
approvalPolicy
Returns the value of theapprovalPolicyrecord component.- Returns:
- the value of the
approvalPolicyrecord component
-
telemetryEnabled
public boolean telemetryEnabled()Returns the value of thetelemetryEnabledrecord component.- Returns:
- the value of the
telemetryEnabledrecord component
-
timeout
-
maxRequestBytes
public int maxRequestBytes()Returns the value of themaxRequestBytesrecord component.- Returns:
- the value of the
maxRequestBytesrecord component
-
maxInputTokens
public long maxInputTokens()Returns the value of themaxInputTokensrecord component.- Returns:
- the value of the
maxInputTokensrecord component
-
maxOutputTokens
public long maxOutputTokens()Returns the value of themaxOutputTokensrecord component.- Returns:
- the value of the
maxOutputTokensrecord component
-
maxCostUsd
Returns the value of themaxCostUsdrecord component.- Returns:
- the value of the
maxCostUsdrecord component
-
retryMaxAttempts
public int retryMaxAttempts()Returns the value of theretryMaxAttemptsrecord component.- Returns:
- the value of the
retryMaxAttemptsrecord component
-
maxConcurrency
public int maxConcurrency()Returns the value of themaxConcurrencyrecord component.- Returns:
- the value of the
maxConcurrencyrecord component
-
circuitBreakerFailureThreshold
public int circuitBreakerFailureThreshold()Returns the value of thecircuitBreakerFailureThresholdrecord component.- Returns:
- the value of the
circuitBreakerFailureThresholdrecord component
-
circuitBreakerCooldown
Returns the value of thecircuitBreakerCooldownrecord component.- Returns:
- the value of the
circuitBreakerCooldownrecord component
-
redactionPolicy
Returns the value of theredactionPolicyrecord component.- Returns:
- the value of the
redactionPolicyrecord component
-
providers
-