Skip to content

Commit 080977f

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: add support for keep alive probe in agent engines
Keep alive probe allows reasoning engine users to configure a probe that a deployment host can use to keep the container alive, based on the probe settings. If the keep alive endpoint returns a 2xx status, the deployment host will make a best effort (up to 1 hour) to keep the container alive. Reasoning engine users with custom container specs (BYOC) have the option to configure a custom keep alive probe while the users without custom container specs (BYOC) have the option to configure an empty keep alive probe {} and the reasoning engine platform will handle the configuration and logic for keep alive probe. To opt in, users should set the keep alive probe field when creating or updating reasoning engines. PiperOrigin-RevId: 899766876
1 parent 5f80eac commit 080977f

4 files changed

Lines changed: 122 additions & 2 deletions

File tree

google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/genai/types/AgentEngineConfig.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ public abstract class AgentEngineConfig extends JsonSerializable {
237237
public abstract Optional<ReasoningEngineSpecDeploymentSpecAgentGatewayConfig>
238238
agentGatewayConfig();
239239

240+
/**
241+
* Optional. Specifies the configuration for keep-alive probe. Contains configuration on a
242+
* specified endpoint that a deployment host should use to keep the container alive based on the
243+
* probe settings.
244+
*/
245+
@JsonProperty("keepAliveProbe")
246+
public abstract Optional<KeepAliveProbe> keepAliveProbe();
247+
240248
/** Instantiates a builder for AgentEngineConfig. */
241249
@ExcludeFromGeneratedCoverageReport
242250
public static Builder builder() {
@@ -1085,6 +1093,38 @@ public Builder clearAgentGatewayConfig() {
10851093
return agentGatewayConfig(Optional.empty());
10861094
}
10871095

1096+
/**
1097+
* Setter for keepAliveProbe.
1098+
*
1099+
* <p>keepAliveProbe: Optional. Specifies the configuration for keep-alive probe. Contains
1100+
* configuration on a specified endpoint that a deployment host should use to keep the container
1101+
* alive based on the probe settings.
1102+
*/
1103+
@JsonProperty("keepAliveProbe")
1104+
public abstract Builder keepAliveProbe(KeepAliveProbe keepAliveProbe);
1105+
1106+
/**
1107+
* Setter for keepAliveProbe builder.
1108+
*
1109+
* <p>keepAliveProbe: Optional. Specifies the configuration for keep-alive probe. Contains
1110+
* configuration on a specified endpoint that a deployment host should use to keep the container
1111+
* alive based on the probe settings.
1112+
*/
1113+
@CanIgnoreReturnValue
1114+
public Builder keepAliveProbe(KeepAliveProbe.Builder keepAliveProbeBuilder) {
1115+
return keepAliveProbe(keepAliveProbeBuilder.build());
1116+
}
1117+
1118+
@ExcludeFromGeneratedCoverageReport
1119+
abstract Builder keepAliveProbe(Optional<KeepAliveProbe> keepAliveProbe);
1120+
1121+
/** Clears the value of keepAliveProbe field. */
1122+
@ExcludeFromGeneratedCoverageReport
1123+
@CanIgnoreReturnValue
1124+
public Builder clearKeepAliveProbe() {
1125+
return keepAliveProbe(Optional.empty());
1126+
}
1127+
10881128
public abstract AgentEngineConfig build();
10891129
}
10901130

google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/genai/types/CreateAgentEngineConfig.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ public abstract class CreateAgentEngineConfig extends JsonSerializable {
178178
public abstract Optional<ReasoningEngineSpecDeploymentSpecAgentGatewayConfig>
179179
agentGatewayConfig();
180180

181+
/**
182+
* Optional. Specifies the configuration for keep-alive probe. Contains configuration on a
183+
* specified endpoint that a deployment host should use to keep the container alive based on the
184+
* probe settings.
185+
*/
186+
@JsonProperty("keepAliveProbe")
187+
public abstract Optional<KeepAliveProbe> keepAliveProbe();
188+
181189
/** Instantiates a builder for CreateAgentEngineConfig. */
182190
@ExcludeFromGeneratedCoverageReport
183191
public static Builder builder() {
@@ -763,6 +771,38 @@ public Builder clearAgentGatewayConfig() {
763771
return agentGatewayConfig(Optional.empty());
764772
}
765773

774+
/**
775+
* Setter for keepAliveProbe.
776+
*
777+
* <p>keepAliveProbe: Optional. Specifies the configuration for keep-alive probe. Contains
778+
* configuration on a specified endpoint that a deployment host should use to keep the container
779+
* alive based on the probe settings.
780+
*/
781+
@JsonProperty("keepAliveProbe")
782+
public abstract Builder keepAliveProbe(KeepAliveProbe keepAliveProbe);
783+
784+
/**
785+
* Setter for keepAliveProbe builder.
786+
*
787+
* <p>keepAliveProbe: Optional. Specifies the configuration for keep-alive probe. Contains
788+
* configuration on a specified endpoint that a deployment host should use to keep the container
789+
* alive based on the probe settings.
790+
*/
791+
@CanIgnoreReturnValue
792+
public Builder keepAliveProbe(KeepAliveProbe.Builder keepAliveProbeBuilder) {
793+
return keepAliveProbe(keepAliveProbeBuilder.build());
794+
}
795+
796+
@ExcludeFromGeneratedCoverageReport
797+
abstract Builder keepAliveProbe(Optional<KeepAliveProbe> keepAliveProbe);
798+
799+
/** Clears the value of keepAliveProbe field. */
800+
@ExcludeFromGeneratedCoverageReport
801+
@CanIgnoreReturnValue
802+
public Builder clearKeepAliveProbe() {
803+
return keepAliveProbe(Optional.empty());
804+
}
805+
766806
public abstract CreateAgentEngineConfig build();
767807
}
768808

google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/genai/types/KeepAliveProbeHttpGet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@AutoValue
3131
@JsonDeserialize(builder = KeepAliveProbeHttpGet.Builder.class)
3232
public abstract class KeepAliveProbeHttpGet extends JsonSerializable {
33-
/** Required. Specifies the path of the HTTP GET request (e.g., `"/is_busy"`). */
33+
/** Required. Specifies the path of the HTTP GET request (e.g., "/is_busy"). */
3434
@JsonProperty("path")
3535
public abstract Optional<String> path();
3636

@@ -59,7 +59,7 @@ private static Builder create() {
5959
/**
6060
* Setter for path.
6161
*
62-
* <p>path: Required. Specifies the path of the HTTP GET request (e.g., `"/is_busy"`).
62+
* <p>path: Required. Specifies the path of the HTTP GET request (e.g., "/is_busy").
6363
*/
6464
@JsonProperty("path")
6565
public abstract Builder path(String path);

google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/genai/types/UpdateAgentEngineConfig.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ public abstract class UpdateAgentEngineConfig extends JsonSerializable {
178178
public abstract Optional<ReasoningEngineSpecDeploymentSpecAgentGatewayConfig>
179179
agentGatewayConfig();
180180

181+
/**
182+
* Optional. Specifies the configuration for keep-alive probe. Contains configuration on a
183+
* specified endpoint that a deployment host should use to keep the container alive based on the
184+
* probe settings.
185+
*/
186+
@JsonProperty("keepAliveProbe")
187+
public abstract Optional<KeepAliveProbe> keepAliveProbe();
188+
181189
/**
182190
* The update mask to apply. For the `FieldMask` definition, see
183191
* https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.
@@ -770,6 +778,38 @@ public Builder clearAgentGatewayConfig() {
770778
return agentGatewayConfig(Optional.empty());
771779
}
772780

781+
/**
782+
* Setter for keepAliveProbe.
783+
*
784+
* <p>keepAliveProbe: Optional. Specifies the configuration for keep-alive probe. Contains
785+
* configuration on a specified endpoint that a deployment host should use to keep the container
786+
* alive based on the probe settings.
787+
*/
788+
@JsonProperty("keepAliveProbe")
789+
public abstract Builder keepAliveProbe(KeepAliveProbe keepAliveProbe);
790+
791+
/**
792+
* Setter for keepAliveProbe builder.
793+
*
794+
* <p>keepAliveProbe: Optional. Specifies the configuration for keep-alive probe. Contains
795+
* configuration on a specified endpoint that a deployment host should use to keep the container
796+
* alive based on the probe settings.
797+
*/
798+
@CanIgnoreReturnValue
799+
public Builder keepAliveProbe(KeepAliveProbe.Builder keepAliveProbeBuilder) {
800+
return keepAliveProbe(keepAliveProbeBuilder.build());
801+
}
802+
803+
@ExcludeFromGeneratedCoverageReport
804+
abstract Builder keepAliveProbe(Optional<KeepAliveProbe> keepAliveProbe);
805+
806+
/** Clears the value of keepAliveProbe field. */
807+
@ExcludeFromGeneratedCoverageReport
808+
@CanIgnoreReturnValue
809+
public Builder clearKeepAliveProbe() {
810+
return keepAliveProbe(Optional.empty());
811+
}
812+
773813
/**
774814
* Setter for updateMask.
775815
*

0 commit comments

Comments
 (0)