Skip to content
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

feat: add code execution tool API #5761

Merged
merged 12 commits into from
Oct 30, 2024
Merged
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
2 changes: 2 additions & 0 deletions packages/google-cloud-aiplatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Notebook_service.list_notebook_runtime_templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtime_templates.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtime_templates.js,packages/google-cloud-aiplatform/samples/README.md) |
| Notebook_service.list_notebook_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtimes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtimes.js,packages/google-cloud-aiplatform/samples/README.md) |
| Notebook_service.start_notebook_runtime | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.start_notebook_runtime.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.start_notebook_runtime.js,packages/google-cloud-aiplatform/samples/README.md) |
| Notebook_service.stop_notebook_runtime | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.stop_notebook_runtime.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.stop_notebook_runtime.js,packages/google-cloud-aiplatform/samples/README.md) |
| Notebook_service.update_notebook_runtime_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.update_notebook_runtime_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.update_notebook_runtime_template.js,packages/google-cloud-aiplatform/samples/README.md) |
| Notebook_service.upgrade_notebook_runtime | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.upgrade_notebook_runtime.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.upgrade_notebook_runtime.js,packages/google-cloud-aiplatform/samples/README.md) |
| Persistent_resource_service.create_persistent_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.create_persistent_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.create_persistent_resource.js,packages/google-cloud-aiplatform/samples/README.md) |
Expand Down Expand Up @@ -433,6 +434,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Endpoint_service.mutate_deployed_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.undeploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.update_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.update_endpoint_long_running | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint_long_running.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint_long_running.js,packages/google-cloud-aiplatform/samples/README.md) |
| Evaluation_service.evaluate_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_instances.js,packages/google-cloud-aiplatform/samples/README.md) |
| Extension_execution_service.execute_extension | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.execute_extension.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.execute_extension.js,packages/google-cloud-aiplatform/samples/README.md) |
| Extension_execution_service.query_extension | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.query_extension.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.query_extension.js,packages/google-cloud-aiplatform/samples/README.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ message GroundingChunk {

// Title of the attribution.
optional string title = 2;

// Text of the attribution.
optional string text = 3;
}

// Chunk type.
Expand Down Expand Up @@ -581,11 +584,11 @@ message SearchEntryPoint {

// Metadata related to retrieval in the grounding flow.
message RetrievalMetadata {
// Optional. Score indicating how likely information from google search could
// Optional. Score indicating how likely information from Google Search could
// help answer the prompt. The score is in the range `[0, 1]`, where 0 is the
// least likely and 1 is the most likely. This score is only populated when
// google search grounding and dynamic retrieval is enabled. It will be
// compared to the threshold to determine whether to trigger google search.
// Google Search grounding and dynamic retrieval is enabled. It will be
// compared to the threshold to determine whether to trigger Google Search.
float google_search_dynamic_retrieval_score = 2
[(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,20 @@ service NotebookService {
};
}

// Stops a NotebookRuntime.
rpc StopNotebookRuntime(StopNotebookRuntimeRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}:stop"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "StopNotebookRuntimeResponse"
metadata_type: "StopNotebookRuntimeOperationMetadata"
};
}

// Creates a NotebookExecutionJob.
rpc CreateNotebookExecutionJob(CreateNotebookExecutionJobRequest)
returns (google.longrunning.Operation) {
Expand Down Expand Up @@ -598,6 +612,32 @@ message StartNotebookRuntimeOperationMetadata {
// [NotebookService.StartNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StartNotebookRuntime].
message StartNotebookRuntimeResponse {}

// Request message for
// [NotebookService.StopNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StopNotebookRuntime].
message StopNotebookRuntimeRequest {
// Required. The name of the NotebookRuntime resource to be stopped.
// Instead of checking whether the name is in valid NotebookRuntime resource
// name format, directly throw NotFound exception if there is no such
// NotebookRuntime in spanner.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/NotebookRuntime"
}
];
}

// Metadata information for
// [NotebookService.StopNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StopNotebookRuntime].
message StopNotebookRuntimeOperationMetadata {
// The operation generic information.
GenericOperationMetadata generic_metadata = 1;
}

// Response message for
// [NotebookService.StopNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StopNotebookRuntime].
message StopNotebookRuntimeResponse {}

// Request message for [NotebookService.CreateNotebookExecutionJob]
message CreateNotebookExecutionJobRequest {
// Required. The resource name of the Location to create the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ message Retrieval {
}

// Retrieve from Vertex AI Search datastore for grounding.
// See https://cloud.google.com/vertex-ai-search-and-conversation
// See https://cloud.google.com/products/agent-builder
message VertexAISearch {
// Required. Fully-qualified Vertex AI Search's datastore resource ID.
// Required. Fully-qualified Vertex AI Search data store resource ID.
// Format:
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
string datastore = 1 [(google.api.field_behavior) = REQUIRED];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ message Part {
// the model.
FunctionResponse function_response = 6
[(google.api.field_behavior) = OPTIONAL];

// Optional. Code generated by the model that is meant to be executed.
ExecutableCode executable_code = 8 [(google.api.field_behavior) = OPTIONAL];

// Optional. Result of executing the [ExecutableCode].
CodeExecutionResult code_execution_result = 9
[(google.api.field_behavior) = OPTIONAL];
}

oneof metadata {
Expand Down Expand Up @@ -236,6 +243,10 @@ message GenerationConfig {
// Optional. Routing configuration.
optional RoutingConfig routing_config = 17
[(google.api.field_behavior) = OPTIONAL];

// Optional. If enabled, audio timestamp will be included in the request to
// the model.
optional bool audio_timestamp = 20 [(google.api.field_behavior) = OPTIONAL];
}

// Safety settings.
Expand Down Expand Up @@ -512,6 +523,9 @@ message GroundingChunk {

// Title of the attribution.
optional string title = 2;

// Text of the attribution.
optional string text = 3;
}

// Chunk type.
Expand Down Expand Up @@ -582,11 +596,11 @@ message SearchEntryPoint {

// Metadata related to retrieval in the grounding flow.
message RetrievalMetadata {
// Optional. Score indicating how likely information from google search could
// help answer the prompt. The score is in the range [0, 1], where 0 is the
// Optional. Score indicating how likely information from Google Search could
// help answer the prompt. The score is in the range `[0, 1]`, where 0 is the
// least likely and 1 is the most likely. This score is only populated when
// google search grounding and dynamic retrieval is enabled. It will be
// compared to the threshold to determine whether to trigger google search.
// Google Search grounding and dynamic retrieval is enabled. It will be
// compared to the threshold to determine whether to trigger Google Search.
float google_search_dynamic_retrieval_score = 2
[(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import "google/cloud/aiplatform/v1beta1/env_var.proto";
import "google/cloud/aiplatform/v1beta1/io.proto";
import "google/cloud/aiplatform/v1beta1/job_state.proto";
import "google/cloud/aiplatform/v1beta1/machine_resources.proto";
import "google/cloud/aiplatform/v1beta1/service_networking.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
Expand Down Expand Up @@ -178,6 +179,10 @@ message CustomJobSpec {
repeated string reserved_ip_ranges = 13
[(google.api.field_behavior) = OPTIONAL];

// Optional. Configuration for PSC-I for CustomJob.
PscInterfaceConfig psc_interface_config = 21
[(google.api.field_behavior) = OPTIONAL];

// The Cloud Storage location to store the output of this CustomJob or
// HyperparameterTuningJob. For HyperparameterTuningJob,
// the baseOutputDirectory of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import "google/cloud/aiplatform/v1beta1/explanation.proto";
import "google/cloud/aiplatform/v1beta1/io.proto";
import "google/cloud/aiplatform/v1beta1/machine_resources.proto";
import "google/cloud/aiplatform/v1beta1/service_networking.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
Expand Down Expand Up @@ -167,6 +168,9 @@ message Endpoint {
string dedicated_endpoint_dns = 25
[(google.api.field_behavior) = OUTPUT_ONLY];

// Configurations that are applied to the endpoint for online prediction.
ClientConnectionConfig client_connection_config = 23;

// Output only. Reserved for future use.
bool satisfies_pzs = 27 [(google.api.field_behavior) = OUTPUT_ONLY];

Expand Down Expand Up @@ -290,6 +294,9 @@ message DeployedModel {
// [network][google.cloud.aiplatform.v1beta1.Endpoint.network] is configured.
PrivateEndpoints private_endpoints = 14
[(google.api.field_behavior) = OUTPUT_ONLY];

// Configuration for faster model deployment.
FasterDeploymentConfig faster_deployment_config = 23;
}

// PrivateEndpoints proto is used to provide paths for users to send
Expand Down Expand Up @@ -329,3 +336,15 @@ message PredictRequestResponseLoggingConfig {
// given, a new table will be created with name `request_response_logging`
BigQueryDestination bigquery_destination = 3;
}

// Configuration for faster model deployment.
message FasterDeploymentConfig {
// If true, enable fast tryout feature for this deployed model.
bool fast_tryout_enabled = 2;
}

// Configurations (e.g. inference timeout) that are applied on your endpoints.
message ClientConnectionConfig {
// Customizable online prediction request timeout.
google.protobuf.Duration inference_timeout = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ service EndpointService {
option (google.api.method_signature) = "endpoint,update_mask";
}

// Updates an Endpoint with a long running operation.
rpc UpdateEndpointLongRunning(UpdateEndpointLongRunningRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{endpoint.name=projects/*/locations/*/endpoints/*}:update"
body: "*"
};
option (google.api.method_signature) = "endpoint";
option (google.longrunning.operation_info) = {
response_type: "Endpoint"
metadata_type: "UpdateEndpointOperationMetadata"
};
}

// Deletes an Endpoint.
rpc DeleteEndpoint(DeleteEndpointRequest)
returns (google.longrunning.Operation) {
Expand Down Expand Up @@ -269,6 +283,22 @@ message UpdateEndpointRequest {
[(google.api.field_behavior) = REQUIRED];
}

// Request message for
// [EndpointService.UpdateEndpointLongRunning][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpointLongRunning].
message UpdateEndpointLongRunningRequest {
// Required. The Endpoint which replaces the resource on the server. Currently
// we only support updating the `client_connection_config` field, all the
// other fields' update will be blocked.
Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED];
}

// Runtime operation information for
// [EndpointService.UpdateEndpointLongRunning][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpointLongRunning].
message UpdateEndpointOperationMetadata {
// The operation generic information.
GenericOperationMetadata generic_metadata = 1;
}

// Request message for
// [EndpointService.DeleteEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeleteEndpoint].
message DeleteEndpointRequest {
Expand Down
Loading
Loading