Skip to content

Commit

Permalink
feat: Automated regeneration of AIPlatform client
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Dec 16, 2024
1 parent bb5db3e commit b35c2c1
Show file tree
Hide file tree
Showing 14 changed files with 367 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clients/ai_platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_ai_platform, "~> 0.25"}]
[{:google_api_ai_platform, "~> 0.26"}]
end
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ defmodule GoogleApi.AIPlatform.V1.Api.Datasets do
## Parameters
* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Output only. Identifier. The resource name of the Dataset.
* `name` (*type:* `String.t`) - Output only. Identifier. The resource name of the Dataset. Format: `projects/{project}/locations/{location}/datasets/{dataset}`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5369,6 +5369,78 @@ defmodule GoogleApi.AIPlatform.V1.Api.Projects do
)
end

@doc """
Streams queries using a reasoning engine.

## Parameters

* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. The name of the ReasoningEngine resource to use. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StreamQueryReasoningEngineRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleApiHttpBody{}}` on success
* `{:error, info}` on failure
"""
@spec aiplatform_projects_locations_reasoning_engines_stream_query(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleApiHttpBody.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def aiplatform_projects_locations_reasoning_engines_stream_query(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+name}:streamQuery", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.AIPlatform.V1.Model.GoogleApiHttpBody{}])
end

@doc """
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.

Expand Down Expand Up @@ -38158,7 +38230,7 @@ defmodule GoogleApi.AIPlatform.V1.Api.Projects do
## Parameters

* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Output only. Identifier. The resource name of the Dataset.
* `name` (*type:* `String.t`) - Output only. Identifier. The resource name of the Dataset. Format: `projects/{project}/locations/{location}/datasets/{dataset}`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.AIPlatform.V1 do
API client metadata for GoogleApi.AIPlatform.V1.
"""

@discovery_revision "20241203"
@discovery_revision "20241210"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Dataset do
* `metadataArtifact` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the Artifact that was created in MetadataStore when creating the Dataset. The Artifact resource name pattern is `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`.
* `metadataSchemaUri` (*type:* `String.t`, *default:* `nil`) - Required. Points to a YAML file stored on Google Cloud Storage describing additional information about the Dataset. The schema is defined as an OpenAPI 3.0.2 Schema Object. The schema files that can be used here are found in gs://google-cloud-aiplatform/schema/dataset/metadata/.
* `modelReference` (*type:* `String.t`, *default:* `nil`) - Optional. Reference to the public base model last used by the dataset. Only set for prompt datasets.
* `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name of the Dataset.
* `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name of the Dataset. Format: `projects/{project}/locations/{location}/datasets/{dataset}`
* `satisfiesPzi` (*type:* `boolean()`, *default:* `nil`) - Output only. Reserved for future use.
* `satisfiesPzs` (*type:* `boolean()`, *default:* `nil`) - Output only. Reserved for future use.
* `savedQueries` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SavedQuery.t)`, *default:* `nil`) - All SavedQueries belong to the Dataset will be returned in List/Get Dataset response. The annotation_specs field will not be populated except for UI cases which will only use annotation_spec_count. In CreateDataset request, a SavedQuery is created together if this field is set, up to one SavedQuery can be set in CreateDatasetRequest. The SavedQuery should not contain any AnnotationSpec.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
* `frequencyPenalty` (*type:* `number()`, *default:* `nil`) - Optional. Frequency penalties.
* `logprobs` (*type:* `integer()`, *default:* `nil`) - Optional. Logit probabilities.
* `maxOutputTokens` (*type:* `integer()`, *default:* `nil`) - Optional. The maximum number of output tokens to generate per message.
* `mediaResolution` (*type:* `String.t`, *default:* `nil`) - Optional. If specified, the media resolution specified will be used.
* `presencePenalty` (*type:* `number()`, *default:* `nil`) - Optional. Positive penalties.
* `responseLogprobs` (*type:* `boolean()`, *default:* `nil`) - Optional. If true, export the logprobs results in response.
* `responseMimeType` (*type:* `String.t`, *default:* `nil`) - Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.
Expand All @@ -36,7 +37,6 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
* `speechConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SpeechConfig.t`, *default:* `nil`) - Optional. The speech generation config.
* `stopSequences` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Stop sequences.
* `temperature` (*type:* `number()`, *default:* `nil`) - Optional. Controls the randomness of predictions.
* `tokenResolution` (*type:* `String.t`, *default:* `nil`) - Optional. If specified, the token resolution specified will be used.
* `topK` (*type:* `number()`, *default:* `nil`) - Optional. If specified, top-k sampling will be used.
* `topP` (*type:* `number()`, *default:* `nil`) - Optional. If specified, nucleus sampling will be used.
"""
Expand All @@ -49,6 +49,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
:frequencyPenalty => number() | nil,
:logprobs => integer() | nil,
:maxOutputTokens => integer() | nil,
:mediaResolution => String.t() | nil,
:presencePenalty => number() | nil,
:responseLogprobs => boolean() | nil,
:responseMimeType => String.t() | nil,
Expand All @@ -63,7 +64,6 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SpeechConfig.t() | nil,
:stopSequences => list(String.t()) | nil,
:temperature => number() | nil,
:tokenResolution => String.t() | nil,
:topK => number() | nil,
:topP => number() | nil
}
Expand All @@ -73,6 +73,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
field(:frequencyPenalty)
field(:logprobs)
field(:maxOutputTokens)
field(:mediaResolution)
field(:presencePenalty)
field(:responseLogprobs)
field(:responseMimeType)
Expand All @@ -87,7 +88,6 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
field(:speechConfig, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SpeechConfig)
field(:stopSequences, type: :list)
field(:temperature)
field(:tokenResolution)
field(:topK)
field(:topP)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelContainerSpe
* `healthProbe` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Probe.t`, *default:* `nil`) - Immutable. Specification for Kubernetes readiness probe.
* `healthRoute` (*type:* `String.t`, *default:* `nil`) - Immutable. HTTP path on the container to send health checks to. Vertex AI intermittently sends GET requests to this path on the container's IP address and port to check that the container is healthy. Read more about [health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). For example, if you set this field to `/bar`, then Vertex AI intermittently sends a GET request to the `/bar` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/ DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
* `imageUri` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. URI of the Docker image to be used as the custom container for serving predictions. This URI must identify an image in Artifact Registry or Container Registry. Learn more about the [container publishing requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), including permissions requirements for the Vertex AI Service Agent. The container image is ingested upon ModelService.UploadModel, stored internally, and this original path is afterwards not used. To learn about the requirements for the Docker image itself, see [Custom container requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). You can use the URI to one of Vertex AI's [pre-built container images for prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) in this field.
* `livenessProbe` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Probe.t`, *default:* `nil`) - Immutable. Specification for Kubernetes liveness probe.
* `ports` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Port.t)`, *default:* `nil`) - Immutable. List of ports to expose from the container. Vertex AI sends any prediction requests that it receives to the first port on this list. Vertex AI also sends [liveness and health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) to this port. If you do not specify this field, it defaults to following value: ```json [ { "containerPort": 8080 } ] ``` Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
* `predictRoute` (*type:* `String.t`, *default:* `nil`) - Immutable. HTTP path on the container to send prediction requests to. Vertex AI forwards requests sent using projects.locations.endpoints.predict to this path on the container's IP address and port. Vertex AI then returns the container's response in the API response. For example, if you set this field to `/foo`, then when Vertex AI receives a prediction request, it forwards the request body in a POST request to the `/foo` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
* `sharedMemorySizeMb` (*type:* `String.t`, *default:* `nil`) - Immutable. The amount of the VM memory to reserve as the shared memory for the model in megabytes.
Expand All @@ -46,6 +47,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelContainerSpe
:healthProbe => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Probe.t() | nil,
:healthRoute => String.t() | nil,
:imageUri => String.t() | nil,
:livenessProbe => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Probe.t() | nil,
:ports => list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Port.t()) | nil,
:predictRoute => String.t() | nil,
:sharedMemorySizeMb => String.t() | nil,
Expand All @@ -60,6 +62,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelContainerSpe
field(:healthProbe, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Probe)
field(:healthRoute)
field(:imageUri)
field(:livenessProbe, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Probe)
field(:ports, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Port, type: :list)
field(:predictRoute)
field(:sharedMemorySizeMb)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,31 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Probe do
## Attributes
* `exec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeExecAction.t`, *default:* `nil`) - ExecAction probes the health of a container by executing a command.
* `grpc` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeGrpcAction.t`, *default:* `nil`) - GrpcAction probes the health of a container by sending a gRPC request.
* `httpGet` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeHttpGetAction.t`, *default:* `nil`) - HttpGetAction probes the health of a container by sending an HTTP GET request.
* `periodSeconds` (*type:* `integer()`, *default:* `nil`) - How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Must be less than timeout_seconds. Maps to Kubernetes probe argument 'periodSeconds'.
* `tcpSocket` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeTcpSocketAction.t`, *default:* `nil`) - TcpSocketAction probes the health of a container by opening a TCP socket connection.
* `timeoutSeconds` (*type:* `integer()`, *default:* `nil`) - Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Must be greater or equal to period_seconds. Maps to Kubernetes probe argument 'timeoutSeconds'.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:exec => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeExecAction.t() | nil,
:grpc => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeGrpcAction.t() | nil,
:httpGet =>
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeHttpGetAction.t() | nil,
:periodSeconds => integer() | nil,
:tcpSocket =>
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeTcpSocketAction.t() | nil,
:timeoutSeconds => integer() | nil
}

field(:exec, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeExecAction)
field(:grpc, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeGrpcAction)
field(:httpGet, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeHttpGetAction)
field(:periodSeconds)
field(:tcpSocket, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ProbeTcpSocketAction)
field(:timeoutSeconds)
end

Expand Down
Loading

0 comments on commit b35c2c1

Please sign in to comment.