Skip to content

Commit

Permalink
feat: Automated regeneration of AIPlatform client (#11259)
Browse files Browse the repository at this point in the history
Auto-created at 2024-04-04 13:12:00 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Apr 4, 2024
1 parent 4baa6a6 commit d6f18b9
Show file tree
Hide file tree
Showing 26 changed files with 1,092 additions and 68 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.5"}]
[{:google_api_ai_platform, "~> 0.6"}]
end
```

Expand Down
297 changes: 297 additions & 0 deletions clients/ai_platform/lib/google_api/ai_platform/v1/api/projects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36729,6 +36729,303 @@ defmodule GoogleApi.AIPlatform.V1.Api.Projects do
)
end

@doc """
Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use GenAiTuningService.GetTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it becomes a job with a TuningJob.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`, and TuningJob.state is set to `CANCELLED`.

## Parameters

* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. The name of the TuningJob to cancel. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
* `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.GoogleCloudAiplatformV1CancelTuningJobRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleProtobufEmpty{}}` on success
* `{:error, info}` on failure
"""
@spec aiplatform_projects_locations_tuning_jobs_cancel(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleProtobufEmpty.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def aiplatform_projects_locations_tuning_jobs_cancel(
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}:cancel", %{
"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.GoogleProtobufEmpty{}])
end

@doc """
Creates a TuningJob. A created TuningJob right away will be attempted to be run.

## Parameters

* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Required. The resource name of the Location to create the TuningJob in. Format: `projects/{project}/locations/{location}`
* `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.GoogleCloudAiplatformV1TuningJob.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningJob{}}` on success
* `{:error, info}` on failure
"""
@spec aiplatform_projects_locations_tuning_jobs_create(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningJob.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def aiplatform_projects_locations_tuning_jobs_create(
connection,
parent,
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/{+parent}/tuningJobs", %{
"parent" => URI.encode(parent, &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.GoogleCloudAiplatformV1TuningJob{}]
)
end

@doc """
Gets a TuningJob.

## Parameters

* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. The name of the TuningJob resource. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
* `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").
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningJob{}}` on success
* `{:error, info}` on failure
"""
@spec aiplatform_projects_locations_tuning_jobs_get(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningJob.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def aiplatform_projects_locations_tuning_jobs_get(
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
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}", %{
"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.GoogleCloudAiplatformV1TuningJob{}]
)
end

@doc """
Lists TuningJobs in a Location.

## Parameters

* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Required. The resource name of the Location to list the TuningJobs from. Format: `projects/{project}/locations/{location}`
* `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").
* `:filter` (*type:* `String.t`) - Optional. The standard list filter.
* `:pageSize` (*type:* `integer()`) - Optional. The standard list page size.
* `:pageToken` (*type:* `String.t`) - Optional. The standard list page token. Typically obtained via ListTuningJob.next_page_token of the previous GenAiTuningService.ListTuningJob][] call.
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ListTuningJobsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec aiplatform_projects_locations_tuning_jobs_list(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ListTuningJobsResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def aiplatform_projects_locations_tuning_jobs_list(
connection,
parent,
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,
:filter => :query,
:pageSize => :query,
:pageToken => :query
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+parent}/tuningJobs", %{
"parent" => URI.encode(parent, &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.GoogleCloudAiplatformV1ListTuningJobsResponse{}]
)
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
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 "20240322"
@discovery_revision "20240328"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.CloudAiNlLlmProtoServiceMessageMetadata
## Attributes
* `factualityDebugMetadata` (*type:* `GoogleApi.AIPlatform.V1.Model.LearningGenaiRootPerRequestProcessorDebugMetadataFactualityDebugMetadata.t`, *default:* `nil`) - Factuality-related debug metadata.
* `inputFilterInfo` (*type:* `GoogleApi.AIPlatform.V1.Model.LearningServingLlmMessageMetadata.t`, *default:* `nil`) - Filter metadata of the input messages.
* `modelRoutingDecision` (*type:* `GoogleApi.AIPlatform.V1.Model.LearningGenaiRootRoutingDecision.t`, *default:* `nil`) - This score is generated by the router model to decide which model to use
* `outputFilterInfo` (*type:* `list(GoogleApi.AIPlatform.V1.Model.LearningServingLlmMessageMetadata.t)`, *default:* `nil`) - Filter metadata of the output messages.
Expand All @@ -29,6 +30,9 @@ defmodule GoogleApi.AIPlatform.V1.Model.CloudAiNlLlmProtoServiceMessageMetadata
use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:factualityDebugMetadata =>
GoogleApi.AIPlatform.V1.Model.LearningGenaiRootPerRequestProcessorDebugMetadataFactualityDebugMetadata.t()
| nil,
:inputFilterInfo =>
GoogleApi.AIPlatform.V1.Model.LearningServingLlmMessageMetadata.t() | nil,
:modelRoutingDecision =>
Expand All @@ -37,6 +41,11 @@ defmodule GoogleApi.AIPlatform.V1.Model.CloudAiNlLlmProtoServiceMessageMetadata
list(GoogleApi.AIPlatform.V1.Model.LearningServingLlmMessageMetadata.t()) | nil
}

field(:factualityDebugMetadata,
as:
GoogleApi.AIPlatform.V1.Model.LearningGenaiRootPerRequestProcessorDebugMetadataFactualityDebugMetadata
)

field(:inputFilterInfo, as: GoogleApi.AIPlatform.V1.Model.LearningServingLlmMessageMetadata)
field(:modelRoutingDecision, as: GoogleApi.AIPlatform.V1.Model.LearningGenaiRootRoutingDecision)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.CloudAiNlLlmProtoServiceRaiResult do
* `filtered` (*type:* `boolean()`, *default:* `nil`) - Whether the text should be filtered and not shown to the end user. This is determined based on a combination of `triggered_recitation`, `triggered_blocklist`, `language_filter_result`, and `triggered_safety_filter`.
* `languageFilterResult` (*type:* `GoogleApi.AIPlatform.V1.Model.LearningGenaiRootLanguageFilterResult.t`, *default:* `nil`) - Language filter result from SAFT LangId.
* `raiSignals` (*type:* `list(GoogleApi.AIPlatform.V1.Model.CloudAiNlLlmProtoServiceRaiSignal.t)`, *default:* `nil`) - The RAI signals for the text.
* `translationRequestInfos` (*type:* `list(GoogleApi.AIPlatform.V1.Model.LearningGenaiRootTranslationRequestInfo.t)`, *default:* `nil`) - Translation request info during RAI for debugging purpose. Each TranslationRequestInfo corresponds to a request sent to the translation server.
* `triggeredBlocklist` (*type:* `boolean()`, *default:* `nil`) - Whether the text triggered the blocklist.
* `triggeredRecitation` (*type:* `boolean()`, *default:* `nil`) - Whether the text should be blocked by the recitation result from Aida recitation checker. It is determined from aida_recitation_result.
* `triggeredSafetyFilter` (*type:* `boolean()`, *default:* `nil`) - Whether the text triggered the safety filter. Currently, this is due to CSAI triggering or one of four categories (derogatory, sexual, toxic, violent) having a score over the filter threshold.
Expand All @@ -45,6 +46,8 @@ defmodule GoogleApi.AIPlatform.V1.Model.CloudAiNlLlmProtoServiceRaiResult do
GoogleApi.AIPlatform.V1.Model.LearningGenaiRootLanguageFilterResult.t() | nil,
:raiSignals =>
list(GoogleApi.AIPlatform.V1.Model.CloudAiNlLlmProtoServiceRaiSignal.t()) | nil,
:translationRequestInfos =>
list(GoogleApi.AIPlatform.V1.Model.LearningGenaiRootTranslationRequestInfo.t()) | nil,
:triggeredBlocklist => boolean() | nil,
:triggeredRecitation => boolean() | nil,
:triggeredSafetyFilter => boolean() | nil
Expand All @@ -67,6 +70,11 @@ defmodule GoogleApi.AIPlatform.V1.Model.CloudAiNlLlmProtoServiceRaiResult do
type: :list
)

field(:translationRequestInfos,
as: GoogleApi.AIPlatform.V1.Model.LearningGenaiRootTranslationRequestInfo,
type: :list
)

field(:triggeredBlocklist)
field(:triggeredRecitation)
field(:triggeredSafetyFilter)
Expand Down
Loading

0 comments on commit d6f18b9

Please sign in to comment.