Class PricingTierCondition.Builder
- All Implemented Interfaces:
PricingTierCondition._FinalStage,PricingTierCondition.CaseSensitiveStage,PricingTierCondition.OperatorStage,PricingTierCondition.UsageDetailPatternStage,PricingTierCondition.ValueStage
- Enclosing class:
PricingTierCondition
-
Method Summary
Modifier and TypeMethodDescriptionadditionalProperties(Map<String, Object> additionalProperties) additionalProperty(String key, Object value) build()caseSensitive(boolean caseSensitive) Whether the regex pattern matching is case-sensitive.from(PricingTierCondition other) operator(PricingTierOperator operator) Comparison operator to apply between the summed value and the threshold.usageDetailPattern(String usageDetailPattern) Regex pattern to match against usage detail keys.value(double value) Threshold value for comparison.
-
Method Details
-
from
- Specified by:
fromin interfacePricingTierCondition.UsageDetailPatternStage
-
usageDetailPattern
Regex pattern to match against usage detail keys. All matching keys' values are summed for threshold comparison.
Examples:
- "^input" matches "input", "input_tokens", "input_cached", etc.
- "^(input|prompt)" matches both "input_tokens" and "prompt_tokens"
- "_cache$" matches "input_cache", "output_cache", etc.
The pattern is case-insensitive by default. If no keys match, the sum is treated as zero.
Regex pattern to match against usage detail keys. All matching keys' values are summed for threshold comparison.
Examples:
- "^input" matches "input", "input_tokens", "input_cached", etc.
- "^(input|prompt)" matches both "input_tokens" and "prompt_tokens"
- "_cache$" matches "input_cache", "output_cache", etc.
The pattern is case-insensitive by default. If no keys match, the sum is treated as zero.
- Specified by:
usageDetailPatternin interfacePricingTierCondition.UsageDetailPatternStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
operator
Comparison operator to apply between the summed value and the threshold.
- gt: greater than (sum > threshold)
- gte: greater than or equal (sum >= threshold)
- lt: less than (sum < threshold)
- lte: less than or equal (sum <= threshold)
- eq: equal (sum == threshold)
- neq: not equal (sum != threshold)
Comparison operator to apply between the summed value and the threshold.
- gt: greater than (sum > threshold)
- gte: greater than or equal (sum >= threshold)
- lt: less than (sum < threshold)
- lte: less than or equal (sum <= threshold)
- eq: equal (sum == threshold)
- neq: not equal (sum != threshold)
- Specified by:
operatorin interfacePricingTierCondition.OperatorStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
value
Threshold value for comparison. For token-based pricing, this is typically the token count threshold (e.g., 200000 for a 200K token threshold).
Threshold value for comparison. For token-based pricing, this is typically the token count threshold (e.g., 200000 for a 200K token threshold).
- Specified by:
valuein interfacePricingTierCondition.ValueStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
caseSensitive
Whether the regex pattern matching is case-sensitive. Default is false (case-insensitive matching).
Whether the regex pattern matching is case-sensitive. Default is false (case-insensitive matching).
- Specified by:
caseSensitivein interfacePricingTierCondition.CaseSensitiveStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
build
- Specified by:
buildin interfacePricingTierCondition._FinalStage
-
additionalProperty
- Specified by:
additionalPropertyin interfacePricingTierCondition._FinalStage
-
additionalProperties
- Specified by:
additionalPropertiesin interfacePricingTierCondition._FinalStage
-