Skip to content

Commit 2f1eb7d

Browse files
feat: Automated regeneration of AIPlatform client (googleapis#12191)
Auto-created at 2024-09-21 13:16:53 +0000 using the toys pull request generator.
1 parent 93ad1ab commit 2f1eb7d

14 files changed

+457
-4
lines changed

clients/ai_platform/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding
1111

1212
```elixir
1313
def deps do
14-
[{:google_api_ai_platform, "~> 0.16"}]
14+
[{:google_api_ai_platform, "~> 0.17"}]
1515
end
1616
```
1717

clients/ai_platform/lib/google_api/ai_platform/v1/api/projects.ex

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39172,6 +39172,80 @@ defmodule GoogleApi.AIPlatform.V1.Api.Projects do
3917239172
)
3917339173
end
3917439174

39175+
@doc """
39176+
Rebase a TunedModel.
39177+
39178+
## Parameters
39179+
39180+
* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
39181+
* `parent` (*type:* `String.t`) - Required. The resource name of the Location into which to rebase the Model. Format: `projects/{project}/locations/{location}`
39182+
* `optional_params` (*type:* `keyword()`) - Optional parameters
39183+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
39184+
* `:access_token` (*type:* `String.t`) - OAuth access token.
39185+
* `:alt` (*type:* `String.t`) - Data format for response.
39186+
* `:callback` (*type:* `String.t`) - JSONP
39187+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
39188+
* `: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.
39189+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
39190+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
39191+
* `: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.
39192+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
39193+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
39194+
* `:body` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RebaseTunedModelRequest.t`) -
39195+
* `opts` (*type:* `keyword()`) - Call options
39196+
39197+
## Returns
39198+
39199+
* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleLongrunningOperation{}}` on success
39200+
* `{:error, info}` on failure
39201+
"""
39202+
@spec aiplatform_projects_locations_tuning_jobs_rebase_tuned_model(
39203+
Tesla.Env.client(),
39204+
String.t(),
39205+
keyword(),
39206+
keyword()
39207+
) ::
39208+
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleLongrunningOperation.t()}
39209+
| {:ok, Tesla.Env.t()}
39210+
| {:ok, list()}
39211+
| {:error, any()}
39212+
def aiplatform_projects_locations_tuning_jobs_rebase_tuned_model(
39213+
connection,
39214+
parent,
39215+
optional_params \\ [],
39216+
opts \\ []
39217+
) do
39218+
optional_params_config = %{
39219+
:"$.xgafv" => :query,
39220+
:access_token => :query,
39221+
:alt => :query,
39222+
:callback => :query,
39223+
:fields => :query,
39224+
:key => :query,
39225+
:oauth_token => :query,
39226+
:prettyPrint => :query,
39227+
:quotaUser => :query,
39228+
:uploadType => :query,
39229+
:upload_protocol => :query,
39230+
:body => :body
39231+
}
39232+
39233+
request =
39234+
Request.new()
39235+
|> Request.method(:post)
39236+
|> Request.url("/v1/{+parent}/tuningJobs:rebaseTunedModel", %{
39237+
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
39238+
})
39239+
|> Request.add_optional_params(optional_params_config, optional_params)
39240+
|> Request.library_version(@library_version)
39241+
39242+
connection
39243+
|> Connection.execute(request)
39244+
|> Response.decode(
39245+
opts ++ [struct: %GoogleApi.AIPlatform.V1.Model.GoogleLongrunningOperation{}]
39246+
)
39247+
end
39248+
3917539249
@doc """
3917639250
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`.
3917739251

@@ -39242,6 +39316,76 @@ defmodule GoogleApi.AIPlatform.V1.Api.Projects do
3924239316
|> Response.decode(opts ++ [struct: %GoogleApi.AIPlatform.V1.Model.GoogleProtobufEmpty{}])
3924339317
end
3924439318

39319+
@doc """
39320+
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
39321+
39322+
## Parameters
39323+
39324+
* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
39325+
* `name` (*type:* `String.t`) - The name of the operation resource to be deleted.
39326+
* `optional_params` (*type:* `keyword()`) - Optional parameters
39327+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
39328+
* `:access_token` (*type:* `String.t`) - OAuth access token.
39329+
* `:alt` (*type:* `String.t`) - Data format for response.
39330+
* `:callback` (*type:* `String.t`) - JSONP
39331+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
39332+
* `: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.
39333+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
39334+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
39335+
* `: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.
39336+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
39337+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
39338+
* `opts` (*type:* `keyword()`) - Call options
39339+
39340+
## Returns
39341+
39342+
* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleProtobufEmpty{}}` on success
39343+
* `{:error, info}` on failure
39344+
"""
39345+
@spec aiplatform_projects_locations_tuning_jobs_operations_delete(
39346+
Tesla.Env.client(),
39347+
String.t(),
39348+
keyword(),
39349+
keyword()
39350+
) ::
39351+
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleProtobufEmpty.t()}
39352+
| {:ok, Tesla.Env.t()}
39353+
| {:ok, list()}
39354+
| {:error, any()}
39355+
def aiplatform_projects_locations_tuning_jobs_operations_delete(
39356+
connection,
39357+
name,
39358+
optional_params \\ [],
39359+
opts \\ []
39360+
) do
39361+
optional_params_config = %{
39362+
:"$.xgafv" => :query,
39363+
:access_token => :query,
39364+
:alt => :query,
39365+
:callback => :query,
39366+
:fields => :query,
39367+
:key => :query,
39368+
:oauth_token => :query,
39369+
:prettyPrint => :query,
39370+
:quotaUser => :query,
39371+
:uploadType => :query,
39372+
:upload_protocol => :query
39373+
}
39374+
39375+
request =
39376+
Request.new()
39377+
|> Request.method(:delete)
39378+
|> Request.url("/v1/{+name}", %{
39379+
"name" => URI.encode(name, &URI.char_unreserved?/1)
39380+
})
39381+
|> Request.add_optional_params(optional_params_config, optional_params)
39382+
|> Request.library_version(@library_version)
39383+
39384+
connection
39385+
|> Connection.execute(request)
39386+
|> Response.decode(opts ++ [struct: %GoogleApi.AIPlatform.V1.Model.GoogleProtobufEmpty{}])
39387+
end
39388+
3924539389
@doc """
3924639390
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
3924739391

clients/ai_platform/lib/google_api/ai_platform/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.AIPlatform.V1 do
2020
API client metadata for GoogleApi.AIPlatform.V1.
2121
"""
2222

23-
@discovery_revision "20240907"
23+
@discovery_revision "20240916"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end

clients/ai_platform/lib/google_api/ai_platform/v1/model/google_cloud_aiplatform_v1_candidate.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Candidate do
2828
* `finishReason` (*type:* `String.t`, *default:* `nil`) - Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.
2929
* `groundingMetadata` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingMetadata.t`, *default:* `nil`) - Output only. Metadata specifies sources used to ground generated content.
3030
* `index` (*type:* `integer()`, *default:* `nil`) - Output only. Index of the candidate.
31+
* `logprobsResult` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResult.t`, *default:* `nil`) - Output only. Log-likelihood scores for the response tokens and top tokens
3132
* `safetyRatings` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SafetyRating.t)`, *default:* `nil`) - Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.
3233
"""
3334

@@ -43,6 +44,8 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Candidate do
4344
:groundingMetadata =>
4445
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingMetadata.t() | nil,
4546
:index => integer() | nil,
47+
:logprobsResult =>
48+
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResult.t() | nil,
4649
:safetyRatings =>
4750
list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SafetyRating.t()) | nil
4851
}
@@ -62,6 +65,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Candidate do
6265
)
6366

6467
field(:index)
68+
field(:logprobsResult, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResult)
6569

6670
field(:safetyRatings,
6771
as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SafetyRating,

clients/ai_platform/lib/google_api/ai_platform/v1/model/google_cloud_aiplatform_v1_generate_content_response.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerateContentRe
2222
## Attributes
2323
2424
* `candidates` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Candidate.t)`, *default:* `nil`) - Output only. Generated candidates.
25+
* `modelVersion` (*type:* `String.t`, *default:* `nil`) - Output only. The model version used to generate the response.
2526
* `promptFeedback` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerateContentResponsePromptFeedback.t`, *default:* `nil`) - Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.
2627
* `usageMetadata` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerateContentResponseUsageMetadata.t`, *default:* `nil`) - Usage metadata about the response(s).
2728
"""
@@ -31,6 +32,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerateContentRe
3132
@type t :: %__MODULE__{
3233
:candidates =>
3334
list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Candidate.t()) | nil,
35+
:modelVersion => String.t() | nil,
3436
:promptFeedback =>
3537
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerateContentResponsePromptFeedback.t()
3638
| nil,
@@ -44,6 +46,8 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerateContentRe
4446
type: :list
4547
)
4648

49+
field(:modelVersion)
50+
4751
field(:promptFeedback,
4852
as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerateContentResponsePromptFeedback
4953
)

clients/ai_platform/lib/google_api/ai_platform/v1/model/google_cloud_aiplatform_v1_generation_config.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
2323
2424
* `candidateCount` (*type:* `integer()`, *default:* `nil`) - Optional. Number of candidates to generate.
2525
* `frequencyPenalty` (*type:* `number()`, *default:* `nil`) - Optional. Frequency penalties.
26+
* `logprobs` (*type:* `integer()`, *default:* `nil`) - Optional. Logit probabilities.
2627
* `maxOutputTokens` (*type:* `integer()`, *default:* `nil`) - Optional. The maximum number of output tokens to generate per message.
2728
* `presencePenalty` (*type:* `number()`, *default:* `nil`) - Optional. Positive penalties.
29+
* `responseLogprobs` (*type:* `boolean()`, *default:* `nil`) - Optional. If true, export the logprobs results in response.
2830
* `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.
2931
* `responseSchema` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.t`, *default:* `nil`) - Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response.
3032
* `routingConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfigRoutingConfig.t`, *default:* `nil`) - Optional. Routing configuration.
@@ -40,8 +42,10 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
4042
@type t :: %__MODULE__{
4143
:candidateCount => integer() | nil,
4244
:frequencyPenalty => number() | nil,
45+
:logprobs => integer() | nil,
4346
:maxOutputTokens => integer() | nil,
4447
:presencePenalty => number() | nil,
48+
:responseLogprobs => boolean() | nil,
4549
:responseMimeType => String.t() | nil,
4650
:responseSchema =>
4751
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.t() | nil,
@@ -57,8 +61,10 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GenerationConfig
5761

5862
field(:candidateCount)
5963
field(:frequencyPenalty)
64+
field(:logprobs)
6065
field(:maxOutputTokens)
6166
field(:presencePenalty)
67+
field(:responseLogprobs)
6268
field(:responseMimeType)
6369
field(:responseSchema, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema)
6470

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResult do
19+
@moduledoc """
20+
Logprobs Result
21+
22+
## Attributes
23+
24+
* `chosenCandidates` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultCandidate.t)`, *default:* `nil`) - Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.
25+
* `topCandidates` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultTopCandidates.t)`, *default:* `nil`) - Length = total number of decoding steps.
26+
"""
27+
28+
use GoogleApi.Gax.ModelBase
29+
30+
@type t :: %__MODULE__{
31+
:chosenCandidates =>
32+
list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultCandidate.t())
33+
| nil,
34+
:topCandidates =>
35+
list(
36+
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultTopCandidates.t()
37+
)
38+
| nil
39+
}
40+
41+
field(:chosenCandidates,
42+
as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultCandidate,
43+
type: :list
44+
)
45+
46+
field(:topCandidates,
47+
as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultTopCandidates,
48+
type: :list
49+
)
50+
end
51+
52+
defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResult do
53+
def decode(value, options) do
54+
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResult.decode(value, options)
55+
end
56+
end
57+
58+
defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResult do
59+
def encode(value, options) do
60+
GoogleApi.Gax.ModelBase.encode(value, options)
61+
end
62+
end
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultCandidate do
19+
@moduledoc """
20+
Candidate for the logprobs token and score.
21+
22+
## Attributes
23+
24+
* `logProbability` (*type:* `number()`, *default:* `nil`) - The candidate's log probability.
25+
* `token` (*type:* `String.t`, *default:* `nil`) - The candidate’s token string value.
26+
* `tokenId` (*type:* `integer()`, *default:* `nil`) - The candidate’s token id value.
27+
"""
28+
29+
use GoogleApi.Gax.ModelBase
30+
31+
@type t :: %__MODULE__{
32+
:logProbability => number() | nil,
33+
:token => String.t() | nil,
34+
:tokenId => integer() | nil
35+
}
36+
37+
field(:logProbability)
38+
field(:token)
39+
field(:tokenId)
40+
end
41+
42+
defimpl Poison.Decoder,
43+
for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultCandidate do
44+
def decode(value, options) do
45+
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultCandidate.decode(
46+
value,
47+
options
48+
)
49+
end
50+
end
51+
52+
defimpl Poison.Encoder,
53+
for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1LogprobsResultCandidate do
54+
def encode(value, options) do
55+
GoogleApi.Gax.ModelBase.encode(value, options)
56+
end
57+
end

0 commit comments

Comments
 (0)