Description
Background story
It seems impossible to set the connection time and read timeout using BedrockRuntimeClient. I have tried using apiCallTimeout and apiCallAttemptTimeout and given a large enough time. When Claude does not return content for more than 30s, the read time out will be thrown. In addition, I did not see where. There are settings for connection time and read time
What does this example accomplish?
I set the reading time to avoid ending early while waiting for Claude to return content. The reading time of 30s is too little.Furthermore, the descriptions of these two methods are too confusing.
Which AWS service(s)?
aws bedrock
Which AWS SDKs or tools?
- All languages
- .NET
- C++
- Go (v2)
- Java
- Java (v2)
- JavaScript
- JavaScript (v3)
- Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
- Not applicable
Are there existing code examples to leverage?
BedrockRuntimeClient client = BedrockRuntimeClient.builder()
.region(Region.US_EAST_1)
.credentialsProvider(ProfileCredentialsProvider.create())
.overrideConfiguration(c -> c.retryPolicy(RetryPolicy.none())
.apiCallAttemptTimeout(Duration.ofMillis(5))
.apiCallAttemptTimeout(Duration.ofMillis(6)))
.build();
Do you have any reference code?
BedrockRuntimeClient client = BedrockRuntimeClient.builder()
.region(Region.US_EAST_1)
.credentialsProvider(ProfileCredentialsProvider.create())
.overrideConfiguration(c -> c.retryPolicy(RetryPolicy.none())
.apiCallAttemptTimeout(Duration.ofMillis(5))
.apiCallAttemptTimeout(Duration.ofMillis(6)))
.build();