Environment details
- API: vertexai
- OS type and version: N/A (code-level issue)
- Java version: N/A
- Version(s): Affects current main branch (commit c70c873)
Description
When location is set to "global", the VertexAI class generates an incorrect API endpoint.
Current behavior:
The endpoint is constructed as global-aiplatform.googleapis.com
Expected behavior:
The endpoint should be aiplatform.googleapis.com (without the global- prefix)
Steps to reproduce
- Create a
VertexAI instance with location set to "global"
- Observe the generated
apiEndpoint
Code example
// Current implementation in VertexAI.java
this.apiEndpoint =
apiEndpoint.orElse(String.format("%s-aiplatform.googleapis.com", this.location));
// When location = "global", this produces:
// "global-aiplatform.googleapis.com" (incorrect)
// Expected:
// "aiplatform.googleapis.com"
Suggested fix
this.apiEndpoint = apiEndpoint.orElse(
"global".equals(this.location)
? "aiplatform.googleapis.com"
: String.format("%s-aiplatform.googleapis.com", this.location)
);
External references
Additional information
The global endpoint aiplatform.googleapis.com is used for accessing Vertex AI resources that are available globally, and it does not follow the regional endpoint pattern of {location}-aiplatform.googleapis.com.
Environment details
Description
When
locationis set to"global", theVertexAIclass generates an incorrect API endpoint.Current behavior:
The endpoint is constructed as
global-aiplatform.googleapis.comExpected behavior:
The endpoint should be
aiplatform.googleapis.com(without theglobal-prefix)Steps to reproduce
VertexAIinstance withlocationset to"global"apiEndpointCode example
Suggested fix
External references
Additional information
The global endpoint
aiplatform.googleapis.comis used for accessing Vertex AI resources that are available globally, and it does not follow the regional endpoint pattern of{location}-aiplatform.googleapis.com.