From 5985d188261aa1028cb889798cbf192f6d3c2899 Mon Sep 17 00:00:00 2001 From: Jaycee Li Date: Thu, 29 Oct 2026 13:44:37 -0700 Subject: [PATCH] docs: clarify that ClientOptions.maxConnections and maxConnectionsPerHost only limit asynchronous requests FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/googleapis/java-genai/pull/1371 from googleapis:release-please--branches--main dea37a49b73d4d3c57eace0419246c310cdcbc1b PiperOrigin-RevId: 1009932283 --- .../com/google/genai/types/ClientOptions.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/google/genai/types/ClientOptions.java b/src/main/java/com/google/genai/types/ClientOptions.java index a680896c2f49..596f8133c148 100644 --- a/src/main/java/com/google/genai/types/ClientOptions.java +++ b/src/main/java/com/google/genai/types/ClientOptions.java @@ -32,11 +32,17 @@ @AutoValue @JsonDeserialize(builder = ClientOptions.Builder.class) public abstract class ClientOptions extends JsonSerializable { - /** The maximum number of connections allowed in the pool. */ + /** + * The maximum number of asynchronous requests that run at the same time. Defaults to 64. + * Synchronous requests are not limited. Ignored when `customHttpClient` is set. + */ @JsonProperty("maxConnections") public abstract Optional maxConnections(); - /** The maximum number of connections allowed per host. */ + /** + * The maximum number of asynchronous requests to the same host that run at the same time. + * Defaults to 5. Synchronous requests are not limited. Ignored when `customHttpClient` is set. + */ @JsonProperty("maxConnectionsPerHost") public abstract Optional maxConnectionsPerHost(); @@ -69,7 +75,8 @@ private static Builder create() { /** * Setter for maxConnections. * - *

maxConnections: The maximum number of connections allowed in the pool. + *

maxConnections: The maximum number of asynchronous requests that run at the same time. + * Defaults to 64. Synchronous requests are not limited. Ignored when `customHttpClient` is set. */ @JsonProperty("maxConnections") public abstract Builder maxConnections(Integer maxConnections); @@ -87,7 +94,9 @@ public Builder clearMaxConnections() { /** * Setter for maxConnectionsPerHost. * - *

maxConnectionsPerHost: The maximum number of connections allowed per host. + *

maxConnectionsPerHost: The maximum number of asynchronous requests to the same host that + * run at the same time. Defaults to 5. Synchronous requests are not limited. Ignored when + * `customHttpClient` is set. */ @JsonProperty("maxConnectionsPerHost") public abstract Builder maxConnectionsPerHost(Integer maxConnectionsPerHost);