Skip to content

Commit

Permalink
feat: Automated regeneration of DiscoveryEngine client (#12130)
Browse files Browse the repository at this point in the history
Auto-created at 2024-09-11 13:19:08 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Sep 11, 2024
1 parent f9c69b5 commit 6897dae
Show file tree
Hide file tree
Showing 77 changed files with 1,061 additions and 152 deletions.
4 changes: 2 additions & 2 deletions clients/discovery_engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_discovery_engine, "~> 0.15"}]
[{:google_api_discovery_engine, "~> 0.16"}]
end
```

## For more information

Product documentation is available at [https://cloud.google.com/discovery-engine/docs](https://cloud.google.com/discovery-engine/docs).
Product documentation is available at [https://cloud.google.com/generative-ai-app-builder/docs/](https://cloud.google.com/generative-ai-app-builder/docs/).

Library reference documentation is published on Hexdocs at
[https://hexdocs.pm/google_api_discovery_engine](https://hexdocs.pm/google_api_discovery_engine).

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.DiscoveryEngine.V1 do
API client metadata for GoogleApi.DiscoveryEngine.V1.
"""

@discovery_revision "20240829"
@discovery_revision "20240906"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQ
## Attributes
* `answerGenerationSpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpec.t`, *default:* `nil`) - Answer generation specification.
* `asynchronousMode` (*type:* `boolean()`, *default:* `nil`) - Asynchronous mode control. If enabled, the response will be returned with answer/session resource name without final answer. The API users need to do the polling to get the latest status of answer/session by calling ConversationalSearchService.GetAnswer or ConversationalSearchService.GetSession method.
* `asynchronousMode` (*type:* `boolean()`, *default:* `nil`) - Deprecated: This field is deprecated. Streaming Answer API will be supported. Asynchronous mode control. If enabled, the response will be returned with answer/session resource name without final answer. The API users need to do the polling to get the latest status of answer/session by calling ConversationalSearchService.GetAnswer or ConversationalSearchService.GetSession method.
* `query` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Query.t`, *default:* `nil`) - Required. Current user query.
* `queryUnderstandingSpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpec.t`, *default:* `nil`) - Query understanding specification.
* `relatedQuestionsSpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestRelatedQuestionsSpec.t`, *default:* `nil`) - Related questions specification.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQ
* `answerLanguageCode` (*type:* `String.t`, *default:* `nil`) - Language code for Answer. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
* `ignoreAdversarialQuery` (*type:* `boolean()`, *default:* `nil`) - Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating answers for adversarial queries and return fallback messages instead.
* `ignoreJailBreakingQuery` (*type:* `boolean()`, *default:* `nil`) - Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. "Reply in the tone of a competing company's CEO". If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
* `ignoreLowRelevantContent` (*type:* `boolean()`, *default:* `nil`) - Specifies whether to filter out queries that have low relevance. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true` or unset, the behavior will be determined automatically by the service.
* `ignoreNonAnswerSeekingQuery` (*type:* `boolean()`, *default:* `nil`) - Specifies whether to filter out queries that are not answer-seeking. The default value is `false`. Google employs search-query classification to detect answer-seeking queries. No answer is returned if the search query is classified as a non-answer seeking query. If this field is set to `true`, we skip generating answers for non-answer seeking queries and return fallback messages instead.
* `includeCitations` (*type:* `boolean()`, *default:* `nil`) - Specifies whether to include citation metadata in the answer. The default value is `false`.
Expand All @@ -35,6 +36,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQ
@type t :: %__MODULE__{
:answerLanguageCode => String.t() | nil,
:ignoreAdversarialQuery => boolean() | nil,
:ignoreJailBreakingQuery => boolean() | nil,
:ignoreLowRelevantContent => boolean() | nil,
:ignoreNonAnswerSeekingQuery => boolean() | nil,
:includeCitations => boolean() | nil,
Expand All @@ -48,6 +50,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQ

field(:answerLanguageCode)
field(:ignoreAdversarialQuery)
field(:ignoreJailBreakingQuery)
field(:ignoreLowRelevantContent)
field(:ignoreNonAnswerSeekingQuery)
field(:includeCitations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,26 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQ
* `chunk` (*type:* `String.t`, *default:* `nil`) - Chunk resource name.
* `content` (*type:* `String.t`, *default:* `nil`) - Chunk textual content.
* `documentMetadata` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata.t`, *default:* `nil`) - Metadata of the document from the current chunk.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:chunk => String.t() | nil,
:content => String.t() | nil
:content => String.t() | nil,
:documentMetadata =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata.t()
| nil
}

field(:chunk)
field(:content)

field(:documentMetadata,
as:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata
)
end

defimpl Poison.Decoder,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata do
@moduledoc """
Document metadata contains the information of the document of the current chunk.
## Attributes
* `title` (*type:* `String.t`, *default:* `nil`) - Title of the document.
* `uri` (*type:* `String.t`, *default:* `nil`) - Uri of the document.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:title => String.t() | nil,
:uri => String.t() | nil
}

field(:title)
field(:uri)
end

defimpl Poison.Decoder,
for:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata do
def decode(value, options) do
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata.decode(
value,
options
)
end
end

defimpl Poison.Encoder,
for:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerS
* `chunkInfo` (*type:* `list(GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerStepActionObservationSearchResultChunkInfo.t)`, *default:* `nil`) - If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate chunk info.
* `document` (*type:* `String.t`, *default:* `nil`) - Document resource name.
* `snippetInfo` (*type:* `list(GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerStepActionObservationSearchResultSnippetInfo.t)`, *default:* `nil`) - If citation_type is DOCUMENT_LEVEL_CITATION, populate document level snippets.
* `structData` (*type:* `map()`, *default:* `nil`) - Data representation. The structured JSON data for the document. It's populated from the struct data from the Document , or the Chunk in search result .
* `structData` (*type:* `map()`, *default:* `nil`) - Data representation. The structured JSON data for the document. It's populated from the struct data from the Document, or the Chunk in search result. .
* `title` (*type:* `String.t`, *default:* `nil`) - Title.
* `uri` (*type:* `String.t`, *default:* `nil`) - URI for the document.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1BatchGe
* `dataIngestionSource` (*type:* `String.t`, *default:* `nil`) - The data ingestion source of the Document. Allowed values are: * `batch`: Data ingested via Batch API, e.g., ImportDocuments. * `streaming` Data ingested via Streaming API, e.g., FHIR streaming.
* `lastRefreshedTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp of the last time the Document was last indexed.
* `matcherValue` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadataMatcherValue.t`, *default:* `nil`) - The value of the matcher that was used to match the Document.
* `status` (*type:* `String.t`, *default:* `nil`) - The status of the document.
* `state` (*type:* `String.t`, *default:* `nil`) - The state of the document.
"""

use GoogleApi.Gax.ModelBase
Expand All @@ -35,7 +35,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1BatchGe
:matcherValue =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadataMatcherValue.t()
| nil,
:status => String.t() | nil
:state => String.t() | nil
}

field(:dataIngestionSource)
Expand All @@ -46,7 +46,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1BatchGe
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadataMatcherValue
)

field(:status)
field(:state)
end

defimpl Poison.Decoder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Convers
* `filter` (*type:* `String.t`, *default:* `nil`) - The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. This will be used to filter search results which may affect the summary response. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customer might have a field 'name' in their schema. In this case the filter would look like this: filter --> name:'ANY("king kong")' For more information about filtering including syntax and filter operators, see [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
* `query` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1TextInput.t`, *default:* `nil`) - Required. Current user input.
* `safeSearch` (*type:* `boolean()`, *default:* `nil`) - Whether to turn on safe search.
* `servingConfig` (*type:* `String.t`, *default:* `nil`) - The resource name of the Serving Config to use. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` If this is not set, the default serving config will be used.
* `servingConfig` (*type:* `String.t`, *default:* `nil`) - The resource name of the Serving Config to use. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` If this is not set, the default serving config will be used.
* `summarySpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSummarySpec.t`, *default:* `nil`) - A specification for configuring the summary returned in the response.
* `userLabels` (*type:* `map()`, *default:* `nil`) - The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CustomT
* `metrics` (*type:* `map()`, *default:* `nil`) - The metrics of the trained model.
* `modelState` (*type:* `String.t`, *default:* `nil`) - The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`).
* `modelVersion` (*type:* `String.t`, *default:* `nil`) - The version of the model.
* `name` (*type:* `String.t`, *default:* `nil`) - Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` model must be an alpha-numerical string with limit of 40 characters.
* `name` (*type:* `String.t`, *default:* `nil`) - Required. The fully qualified resource name of the model. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. Model must be an alpha-numerical string with limit of 40 characters.
* `trainingStartTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp the model training was initiated.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DataSto
* `documentProcessingConfig` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentProcessingConfig.t`, *default:* `nil`) - Configuration for Document understanding and enrichment.
* `industryVertical` (*type:* `String.t`, *default:* `nil`) - Immutable. The industry vertical that the data store registers.
* `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
* `servingConfigDataStore` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1ServingConfigDataStore.t`, *default:* `nil`) - Optional. Stores serving config at DataStore level.
* `solutionTypes` (*type:* `list(String.t)`, *default:* `nil`) - The solutions that the data store enrolls. Available solutions for each industry_vertical: * `MEDIA`: `SOLUTION_TYPE_RECOMMENDATION` and `SOLUTION_TYPE_SEARCH`. * `SITE_SEARCH`: `SOLUTION_TYPE_SEARCH` is automatically enrolled. Other solutions cannot be enrolled.
* `startingSchema` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Schema.t`, *default:* `nil`) - The start schema to use for this DataStore when provisioning it. If unset, a default vertical specialized schema will be used. This field is only used by CreateDataStore API, and will be ignored if used in other APIs. This field will be omitted from all API responses including CreateDataStore API. To retrieve a schema of a DataStore, use SchemaService.GetSchema API instead. The provided schema will be validated against certain rules on schema. Learn more from [this doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema).
* `workspaceConfig` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1WorkspaceConfig.t`, *default:* `nil`) - Config to store data store type configuration for workspace data. This must be set when DataStore.content_config is set as DataStore.ContentConfig.GOOGLE_WORKSPACE.
Expand All @@ -45,6 +46,9 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DataSto
| nil,
:industryVertical => String.t() | nil,
:name => String.t() | nil,
:servingConfigDataStore =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1ServingConfigDataStore.t()
| nil,
:solutionTypes => list(String.t()) | nil,
:startingSchema =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Schema.t() | nil,
Expand All @@ -64,6 +68,11 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DataSto

field(:industryVertical)
field(:name)

field(:servingConfigDataStore,
as: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1ServingConfigDataStore
)

field(:solutionTypes, type: :list)

field(:startingSchema, as: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Schema)
Expand Down
Loading

0 comments on commit 6897dae

Please sign in to comment.