-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- Programming language: Java
- OS: MacOS
- Language runtime version: Azul Zulu 21.0.2
- Package version:
Steps to reproduce
When attempting to use the provided GenerateContentConfig with a timeout specified in HttpOptions we are observing some inconsistencies based on whether or not the initial Client has a specified timeout within HttpOptions.
- Create a new
Clientwith a distinctly low timeout
final Client client = new Client.Builder()
.project(GOOGLE_API_PROJECT)
.location(location)
.credentials(credentials)
.vertexAI(true)
.clientOptions(
ClientOptions.builder()
.maxConnections(MAX_CONNECTIONS)
.maxConnectionsPerHost(MAX_CONNECTIONS)
.build())
.httpOptions(HttpOptions.builder().timeout(100).apiVersion("v1").build())
.build();- Using the client make a call to generate content where
GenerateContentConfighas an override for the timeout in it'sHttpOptions
final GenerateContentConfig config = GenerateContentConfig.builder().
.httpOptions(HttpOptions.builder()
.timeout(30000)
.apiVersion("v1")
.build())
// Rest of builder here
.build();
final GenerateContentResponse response = client.models
.generateContent(modelName, contentParts, config);- Observe that the call immediately times out despite having provided a larger timeout window
- Repeat above steps while omitting the default timeout and
HttpOptionsduring client creation - Observe that the call respects the provided timeout from
GenerateContentConfig
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.