Package com.anthropic.core
Class RequestOptions.Builder
-
- All Implemented Interfaces:
public final class RequestOptions.Builder
-
-
Method Summary
Modifier and Type Method Description final RequestOptions.BuilderresponseValidation(Boolean responseValidation)Whether to call validateon the response before returning it.final RequestOptions.Buildertimeout(Timeout timeout)final RequestOptions.Buildertimeout(Duration timeout)final RequestOptions.BuilderfollowRedirects(Boolean followRedirects)Whether to follow redirects. final RequestOptions.BuilderfallbackState(BetaFallbackState fallbackState)Sticky state for com.anthropic.helpers.BetaRefusalFallbackInterceptor. final RequestOptions.BuilderopenTelemetry(OpenTelemetryRequestOptions openTelemetry)The OpenTelemetry tracing of this request. final RequestOptionsbuild()-
-
Method Detail
-
responseValidation
final RequestOptions.Builder responseValidation(Boolean responseValidation)
Whether to call
validateon the response before returning it.Setting this to
trueis not forwards compatible with new types from the API for existing fields.Defaults to false, which means the shape of the response will not be validated upfront. Instead, validation will only occur for the parts of the response that are accessed.
-
timeout
final RequestOptions.Builder timeout(Timeout timeout)
-
timeout
final RequestOptions.Builder timeout(Duration timeout)
-
followRedirects
final RequestOptions.Builder followRedirects(Boolean followRedirects)
Whether to follow redirects.
Defaults to true.
-
fallbackState
final RequestOptions.Builder fallbackState(BetaFallbackState fallbackState)
Sticky state for com.anthropic.helpers.BetaRefusalFallbackInterceptor.
The interceptor records which fallback it settled on, so requests sharing the state skip models that already refused. Pass the same object across whatever scope the pin should apply to — typically a conversation.
-
openTelemetry
final RequestOptions.Builder openTelemetry(OpenTelemetryRequestOptions openTelemetry)
The OpenTelemetry tracing of this request.
-
build
final RequestOptions build()
-
-
-
-