aws-doc-sdk-examples icon indicating copy to clipboard operation
aws-doc-sdk-examples copied to clipboard

BedrockRuntimeClient can't seem to set the read time and connect time

Open ryu6 opened this issue 1 year ago • 0 comments

Background story

image 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
  • [X] 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();

ryu6 avatar Mar 21 '24 12:03 ryu6