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: promote recommendation service to v1 #25673

Merged
merged 2 commits into from
Apr 18, 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
14 changes: 14 additions & 0 deletions google-cloud-discovery_engine-v1/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
"lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb",
"lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb",
"lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb",
"lib/google/cloud/discovery_engine/v1/recommendation_service.rb",
"lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb",
"lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb",
"lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb",
"lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb",
"lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb",
"lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb",
"lib/google/cloud/discovery_engine/v1/rest.rb",
"lib/google/cloud/discovery_engine/v1/schema_service.rb",
"lib/google/cloud/discovery_engine/v1/schema_service/client.rb",
Expand Down Expand Up @@ -112,6 +119,8 @@
"lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb",
"lib/google/cloud/discoveryengine/v1/import_config_pb.rb",
"lib/google/cloud/discoveryengine/v1/purge_config_pb.rb",
"lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb",
"lib/google/cloud/discoveryengine/v1/recommendation_service_services_pb.rb",
"lib/google/cloud/discoveryengine/v1/schema_pb.rb",
"lib/google/cloud/discoveryengine/v1/schema_service_pb.rb",
"lib/google/cloud/discoveryengine/v1/schema_service_services_pb.rb",
Expand Down Expand Up @@ -142,6 +151,7 @@
"proto_docs/google/cloud/discoveryengine/v1/engine_service.rb",
"proto_docs/google/cloud/discoveryengine/v1/import_config.rb",
"proto_docs/google/cloud/discoveryengine/v1/purge_config.rb",
"proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb",
"proto_docs/google/cloud/discoveryengine/v1/schema.rb",
"proto_docs/google/cloud/discoveryengine/v1/schema_service.rb",
"proto_docs/google/cloud/discoveryengine/v1/search_service.rb",
Expand Down Expand Up @@ -185,6 +195,7 @@
"snippets/engine_service/get_engine.rb",
"snippets/engine_service/list_engines.rb",
"snippets/engine_service/update_engine.rb",
"snippets/recommendation_service/recommend.rb",
"snippets/schema_service/create_schema.rb",
"snippets/schema_service/delete_schema.rb",
"snippets/schema_service/get_schema.rb",
Expand Down Expand Up @@ -226,6 +237,9 @@
"test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb",
"test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb",
"test/google/cloud/discovery_engine/v1/engine_service_test.rb",
"test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb",
"test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb",
"test/google/cloud/discovery_engine/v1/recommendation_service_test.rb",
"test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb",
"test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb",
"test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb",
Expand Down
14 changes: 14 additions & 0 deletions google-cloud-discovery_engine-v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,20 @@
}
}
},
"RecommendationService": {
"clients": {
"grpc": {
"libraryClient": "::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client",
"rpcs": {
"Recommend": {
"methods": [
"recommend"
]
}
}
}
}
},
"SchemaService": {
"clients": {
"grpc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
require "google/cloud/discovery_engine/v1/data_store_service"
require "google/cloud/discovery_engine/v1/document_service"
require "google/cloud/discovery_engine/v1/engine_service"
require "google/cloud/discovery_engine/v1/recommendation_service"
require "google/cloud/discovery_engine/v1/schema_service"
require "google/cloud/discovery_engine/v1/site_search_engine_service"
require "google/cloud/discovery_engine/v1/user_event_service"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def initialize
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil)
# @overload converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil, boost_spec: nil)
# Pass arguments to `converse_conversation` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
Expand Down Expand Up @@ -254,6 +254,10 @@ def initialize
# For more information about filtering including syntax and filter
# operators, see
# [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
# @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash]
# Boost specification to boost certain documents in search results which may
# affect the converse response. For more information on boosting, see
# [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def initialize
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @overload converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil)
# @overload converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil, boost_spec: nil)
# Pass arguments to `converse_conversation` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
Expand Down Expand Up @@ -247,6 +247,10 @@ def initialize
# For more information about filtering including syntax and filter
# operators, see
# [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
# @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash]
# Boost specification to boost certain documents in search results which may
# affect the converse response. For more information on boosting, see
# [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,55 @@ def data_store_path **args
resource.call(**args)
end

##
# Create a fully-qualified Schema resource string.
#
# @overload schema_path(project:, location:, data_store:, schema:)
# The resource will be in the following format:
#
# `projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}`
#
# @param project [String]
# @param location [String]
# @param data_store [String]
# @param schema [String]
#
# @overload schema_path(project:, location:, collection:, data_store:, schema:)
# The resource will be in the following format:
#
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`
#
# @param project [String]
# @param location [String]
# @param collection [String]
# @param data_store [String]
# @param schema [String]
#
# @return [::String]
def schema_path **args
resources = {
"data_store:location:project:schema" => (proc do |project:, location:, data_store:, schema:|
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"

"projects/#{project}/locations/#{location}/dataStores/#{data_store}/schemas/#{schema}"
end),
"collection:data_store:location:project:schema" => (proc do |project:, location:, collection:, data_store:, schema:|
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"

"projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/schemas/#{schema}"
end)
}

resource = resources[args.keys.sort.join(":")]
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
resource.call(**args)
end

extend self
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def create_document request, options = nil
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload update_document(document: nil, allow_missing: nil)
# @overload update_document(document: nil, allow_missing: nil, update_mask: nil)
# Pass arguments to `update_document` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
Expand All @@ -549,6 +549,9 @@ def create_document request, options = nil
# If set to true, and the
# {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not found, a new
# {::Google::Cloud::DiscoveryEngine::V1::Document Document} will be created.
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
# Indicates which fields in the provided imported 'document' to update. If
# not set, will by default update all fields.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Document]
Expand Down Expand Up @@ -727,7 +730,7 @@ def delete_document request, options = nil
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, auto_generate_ids: nil, id_field: nil)
# @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil)
# Pass arguments to `import_documents` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
Expand All @@ -738,6 +741,16 @@ def delete_document request, options = nil
# Cloud Storage location for the input content.
# @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash]
# BigQuery input source.
# @param fhir_store_source [::Google::Cloud::DiscoveryEngine::V1::FhirStoreSource, ::Hash]
# FhirStore input source.
# @param spanner_source [::Google::Cloud::DiscoveryEngine::V1::SpannerSource, ::Hash]
# Spanner input source.
# @param cloud_sql_source [::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource, ::Hash]
# Cloud SQL input source.
# @param firestore_source [::Google::Cloud::DiscoveryEngine::V1::FirestoreSource, ::Hash]
# Firestore input source.
# @param bigtable_source [::Google::Cloud::DiscoveryEngine::V1::BigtableSource, ::Hash]
# Cloud Bigtable input source.
# @param parent [::String]
# Required. The parent branch resource name, such as
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
Expand All @@ -748,6 +761,9 @@ def delete_document request, options = nil
# The mode of reconciliation between existing documents and the documents to
# be imported. Defaults to
# {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}.
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
# Indicates which fields in the provided imported documents to update. If
# not set, the default is to update all fields.
# @param auto_generate_ids [::Boolean]
# Whether to automatically generate IDs for the documents if absent.
#
Expand All @@ -762,42 +778,54 @@ def delete_document request, options = nil
# {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#id_field id_field},
# otherwise, documents without IDs fail to be imported.
#
# Only set this field when using
# {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} or
# {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}, and when
# Supported data sources:
#
# * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}.
# {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema}
# or
# must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
# * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}.
# {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema}
# is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
# must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
# * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}.
# * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}.
# * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}.
# * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}.
# @param id_field [::String]
# The field in the Cloud Storage and BigQuery sources that indicates the
# unique IDs of the documents.
# The field indicates the ID field or column to be used as unique IDs of
# the documents.
#
# For {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} it is the key of
# the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`.
# For {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource} it is
# the column name of the BigQuery table where the unique ids are stored.
# For others, it may be the column name of the table where the unique ids are
# stored.
#
# The values of the JSON field or the BigQuery column are used as the
# The values of the JSON field or the table column are used as the
# {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s. The JSON field
# or the BigQuery column must be of string type, and the values must be set
# as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
# or the table column must be of string type, and the values must be set as
# valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
# with 1-63 characters. Otherwise, documents without valid IDs fail to be
# imported.
#
# Only set this field when using
# {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} or
# {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}, and when
# {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema}
# or
# {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema}
# is `custom`. And only set this field when
# Only set this field when
# {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#auto_generate_ids auto_generate_ids}
# is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
#
# If it is unset, a default value `_id` is used when importing from the
# allowed data sources.
#
# Supported data sources:
#
# * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}.
# {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema}
# must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
# * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}.
# {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema}
# must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
# * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}.
# * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}.
# * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}.
# * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Gapic::Operation]
# @yieldparam operation [::GRPC::ActiveCall::Operation]
Expand Down
Loading