Skip to content

chore: prepare java-vertexai release #11516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gapic-libraries-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.google.cloud</groupId>
<artifactId>gapic-libraries-bom</artifactId>
<packaging>pom</packaging>
<version>1.54.0</version><!-- {x-version-update:google-cloud-java:current} -->
<version>1.54.1</version><!-- {x-version-update:google-cloud-java:current} -->
<name>Google Cloud Java BOM</name>
<description>
BOM for the libraries in google-cloud-java repository. Users should not
Expand All @@ -15,7 +15,7 @@
<parent>
<artifactId>google-cloud-pom-parent</artifactId>
<groupId>com.google.cloud</groupId>
<version>1.54.0</version><!-- {x-version-update:google-cloud-java:current} -->
<version>1.54.1</version><!-- {x-version-update:google-cloud-java:current} -->
<relativePath>../google-cloud-pom-parent/pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -1182,7 +1182,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai-bom</artifactId>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-jar-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>google-cloud-jar-parent</artifactId>
<groupId>com.google.cloud</groupId>
<version>1.54.0</version><!-- {x-version-update:google-cloud-java:current} -->
<version>1.54.1</version><!-- {x-version-update:google-cloud-java:current} -->
<packaging>pom</packaging>
<name>Google Cloud JAR Parent</name>
<description>
Expand All @@ -15,7 +15,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom-parent</artifactId>
<version>1.54.0</version><!-- {x-version-update:google-cloud-java:current} -->
<version>1.54.1</version><!-- {x-version-update:google-cloud-java:current} -->
<relativePath>../google-cloud-pom-parent/pom.xml</relativePath>
</parent>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-pom-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>google-cloud-pom-parent</artifactId>
<groupId>com.google.cloud</groupId>
<version>1.54.0</version><!-- {x-version-update:google-cloud-java:current} -->
<version>1.54.1</version><!-- {x-version-update:google-cloud-java:current} -->
<packaging>pom</packaging>
<name>Google Cloud POM Parent</name>
<url>https://github.com/googleapis/google-cloud-java</url>
Expand Down
10 changes: 5 additions & 5 deletions java-vertexai/google-cloud-vertexai-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai-bom</artifactId>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<packaging>pom</packaging>

<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom-parent</artifactId>
<version>1.54.0</version><!-- {x-version-update:google-cloud-java:current} -->
<version>1.54.1</version><!-- {x-version-update:google-cloud-java:current} -->
<relativePath>../../google-cloud-pom-parent/pom.xml</relativePath>
</parent>

Expand All @@ -27,17 +27,17 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai</artifactId>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-vertexai-v1</artifactId>
<version>1.20.0</version><!-- {x-version-update:grpc-google-cloud-vertexai-v1:current} -->
<version>1.20.1</version><!-- {x-version-update:grpc-google-cloud-vertexai-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-vertexai-v1</artifactId>
<version>1.20.0</version><!-- {x-version-update:proto-google-cloud-vertexai-v1:current} -->
<version>1.20.1</version><!-- {x-version-update:proto-google-cloud-vertexai-v1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions java-vertexai/google-cloud-vertexai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai</artifactId>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<packaging>jar</packaging>
<name>Google VertexAI API</name>
<description>VertexAI API Vertex AI is an integrated suite of machine learning tools and services
Expand All @@ -12,7 +12,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai-parent</artifactId>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-vertexai</site.installationModule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,6 @@ private PredictionServiceSettings getPredictionServiceSettings() throws IOExcept
builder.setEndpoint(String.format("%s:443", apiEndpoint));
builder.setCredentialsProvider(credentialsProvider);

HeaderProvider headerProvider =
FixedHeaderProvider.create(
"user-agent",
String.format(
"%s/%s",
Constants.USER_AGENT_HEADER,
GaxProperties.getLibraryVersion(PredictionServiceSettings.class)));
builder.setHeaderProvider(headerProvider);
return builder.build();
}
Expand Down Expand Up @@ -435,13 +428,6 @@ private LlmUtilityServiceSettings getLlmUtilityServiceClientSettings() throws IO
settingsBuilder.setEndpoint(String.format("%s:443", apiEndpoint));
settingsBuilder.setCredentialsProvider(credentialsProvider);

HeaderProvider headerProvider =
FixedHeaderProvider.create(
"user-agent",
String.format(
"%s/%s",
Constants.USER_AGENT_HEADER,
GaxProperties.getLibraryVersion(LlmUtilityServiceSettings.class)));
settingsBuilder.setHeaderProvider(headerProvider);
return settingsBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.vertexai.api.LlmUtilityServiceClient;
import com.google.cloud.vertexai.api.LlmUtilityServiceSettings;
import com.google.cloud.vertexai.api.PredictionServiceClient;
import com.google.cloud.vertexai.api.PredictionServiceSettings;
import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -58,6 +60,8 @@ public final class VertexAITest {

@Mock private PredictionServiceClient mockPredictionServiceClient;

@Mock private LlmUtilityServiceClient mockLlmUtilityServiceClient;

@Mock private GoogleCredentialsProvider.Builder mockCredentialsProviderBuilder;

@Mock private GoogleCredentialsProvider mockCredentialsProvider;
Expand Down Expand Up @@ -425,6 +429,20 @@ public void testInstantiateVertexAI_builderWithCustomHeaders_shouldContainRightF
Constants.USER_AGENT_HEADER,
GaxProperties.getLibraryVersion(PredictionServiceSettings.class)));
assertThat(vertexAi.getHeaders()).isEqualTo(expectedHeaders);

// make sure the custom headers are set correctly in the prediction service client
try (MockedStatic mockStatic = mockStatic(PredictionServiceClient.class)) {
mockStatic
.when(() -> PredictionServiceClient.create(any(PredictionServiceSettings.class)))
.thenReturn(mockPredictionServiceClient);
PredictionServiceClient unused = vertexAi.getPredictionServiceClient();

ArgumentCaptor<PredictionServiceSettings> settings =
ArgumentCaptor.forClass(PredictionServiceSettings.class);
mockStatic.verify(() -> PredictionServiceClient.create(settings.capture()));

assertThat(settings.getValue().getHeaderProvider().getHeaders()).isEqualTo(expectedHeaders);
}
}

@Test
Expand Down Expand Up @@ -454,5 +472,19 @@ public void testInstantiateVertexAI_builderWithCustomHeaders_shouldContainRightF
GaxProperties.getLibraryVersion(PredictionServiceSettings.class),
"test_value"));
assertThat(vertexAi.getHeaders()).isEqualTo(expectedHeaders);

// make sure the custom headers are set correctly in the llm utility service client
try (MockedStatic mockStatic = mockStatic(LlmUtilityServiceClient.class)) {
mockStatic
.when(() -> LlmUtilityServiceClient.create(any(LlmUtilityServiceSettings.class)))
.thenReturn(mockLlmUtilityServiceClient);
LlmUtilityServiceClient unused = vertexAi.getLlmUtilityClient();

ArgumentCaptor<LlmUtilityServiceSettings> settings =
ArgumentCaptor.forClass(LlmUtilityServiceSettings.class);
mockStatic.verify(() -> LlmUtilityServiceClient.create(settings.capture()));

assertThat(settings.getValue().getHeaderProvider().getHeaders()).isEqualTo(expectedHeaders);
}
}
}
4 changes: 2 additions & 2 deletions java-vertexai/grpc-google-cloud-vertexai-v1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-vertexai-v1</artifactId>
<version>1.20.0</version><!-- {x-version-update:grpc-google-cloud-vertexai-v1:current} -->
<version>1.20.1</version><!-- {x-version-update:grpc-google-cloud-vertexai-v1:current} -->
<name>grpc-google-cloud-vertexai-v1</name>
<description>GRPC library for google-cloud-vertexai</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai-parent</artifactId>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
10 changes: 5 additions & 5 deletions java-vertexai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai-parent</artifactId>
<packaging>pom</packaging>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<name>Google VertexAI API Parent</name>
<description>
Java idiomatic client for Google Cloud Platform services.
Expand All @@ -13,7 +13,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-jar-parent</artifactId>
<version>1.54.0</version><!-- {x-version-update:google-cloud-java:current} -->
<version>1.54.1</version><!-- {x-version-update:google-cloud-java:current} -->
<relativePath>../google-cloud-jar-parent/pom.xml</relativePath>
</parent>

Expand All @@ -29,17 +29,17 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai</artifactId>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-vertexai-v1</artifactId>
<version>1.20.0</version><!-- {x-version-update:grpc-google-cloud-vertexai-v1:current} -->
<version>1.20.1</version><!-- {x-version-update:grpc-google-cloud-vertexai-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-vertexai-v1</artifactId>
<version>1.20.0</version><!-- {x-version-update:proto-google-cloud-vertexai-v1:current} -->
<version>1.20.1</version><!-- {x-version-update:proto-google-cloud-vertexai-v1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions java-vertexai/proto-google-cloud-vertexai-v1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-vertexai-v1</artifactId>
<version>1.20.0</version><!-- {x-version-update:proto-google-cloud-vertexai-v1:current} -->
<version>1.20.1</version><!-- {x-version-update:proto-google-cloud-vertexai-v1:current} -->
<name>proto-google-cloud-vertexai-v1</name>
<description>Proto library for google-cloud-vertexai</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai-parent</artifactId>
<version>1.20.0</version><!-- {x-version-update:google-cloud-vertexai:current} -->
<version>1.20.1</version><!-- {x-version-update:google-cloud-vertexai:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
14 changes: 7 additions & 7 deletions versions.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Format:
# module:released-version:current-version

google-cloud-java:1.54.0:1.54.0
google-cloud-java:1.54.1:1.54.1
google-cloud-accessapproval:2.61.0:2.61.0
grpc-google-cloud-accessapproval-v1:2.61.0:2.61.0
proto-google-cloud-accessapproval-v1:2.61.0:2.61.0
Expand Down Expand Up @@ -690,11 +690,11 @@ grpc-google-cloud-telcoautomation-v1alpha1:0.30.0:0.30.0
google-cloud-securesourcemanager:0.30.0:0.30.0
proto-google-cloud-securesourcemanager-v1:0.30.0:0.30.0
grpc-google-cloud-securesourcemanager-v1:0.30.0:0.30.0
google-cloud-vertexai:1.20.0:1.20.0
proto-google-cloud-vertexai-v1:1.20.0:1.20.0
proto-google-cloud-vertexai-v1beta1:1.20.0:1.20.0
grpc-google-cloud-vertexai-v1:1.20.0:1.20.0
grpc-google-cloud-vertexai-v1beta1:1.20.0:1.20.0
google-cloud-vertexai:1.20.1:1.20.1
proto-google-cloud-vertexai-v1:1.20.1:1.20.1
proto-google-cloud-vertexai-v1beta1:1.20.1:1.20.1
grpc-google-cloud-vertexai-v1:1.20.1:1.20.1
grpc-google-cloud-vertexai-v1beta1:1.20.1:1.20.1
google-cloud-edgenetwork:0.28.0:0.28.0
proto-google-cloud-edgenetwork-v1:0.28.0:0.28.0
grpc-google-cloud-edgenetwork-v1:0.28.0:0.28.0
Expand Down Expand Up @@ -830,4 +830,4 @@ proto-google-cloud-modelarmor-v1:0.1.0:0.1.0
grpc-google-cloud-modelarmor-v1:0.1.0:0.1.0
google-cloud-financialservices:0.1.0:0.1.0
proto-google-cloud-financialservices-v1:0.1.0:0.1.0
grpc-google-cloud-financialservices-v1:0.1.0:0.1.0
grpc-google-cloud-financialservices-v1:0.1.0:0.1.0