google-cloud-dataqna-v1alpha 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/README.md +2 -2
- data/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/client.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/credentials.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/paths.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/rest/client.rb +510 -0
- data/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/rest/service_stub.rb +143 -0
- data/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/rest.rb +117 -0
- data/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service.rb +7 -1
- data/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service_services_pb.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha/question_service/client.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha/question_service/credentials.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha/question_service/paths.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha/question_service/rest/client.rb +808 -0
- data/lib/google/cloud/dataqna/v1alpha/question_service/rest/service_stub.rb +389 -0
- data/lib/google/cloud/dataqna/v1alpha/question_service/rest.rb +66 -0
- data/lib/google/cloud/dataqna/v1alpha/question_service.rb +7 -1
- data/lib/google/cloud/dataqna/v1alpha/question_service_services_pb.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha/rest.rb +38 -0
- data/lib/google/cloud/dataqna/v1alpha/version.rb +1 -1
- data/lib/google/cloud/dataqna/v1alpha.rb +6 -1
- data/lib/google-cloud-dataqna-v1alpha.rb +1 -1
- data/proto_docs/README.md +1 -1
- data/proto_docs/google/api/client.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +1 -1
- data/proto_docs/google/api/launch_stage.rb +1 -1
- data/proto_docs/google/api/resource.rb +1 -1
- data/proto_docs/google/cloud/dataqna/v1alpha/annotated_string.rb +1 -1
- data/proto_docs/google/cloud/dataqna/v1alpha/auto_suggestion_service.rb +1 -1
- data/proto_docs/google/cloud/dataqna/v1alpha/question.rb +1 -1
- data/proto_docs/google/cloud/dataqna/v1alpha/question_service.rb +1 -1
- data/proto_docs/google/cloud/dataqna/v1alpha/user_feedback.rb +1 -1
- data/proto_docs/google/protobuf/any.rb +1 -1
- data/proto_docs/google/protobuf/duration.rb +1 -1
- data/proto_docs/google/protobuf/field_mask.rb +1 -1
- data/proto_docs/google/protobuf/timestamp.rb +8 -7
- data/proto_docs/google/rpc/status.rb +1 -1
- metadata +8 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
require "google/cloud/dataqna/v1alpha/auto_suggestion_service_pb"
|
|
20
|
+
|
|
21
|
+
module Google
|
|
22
|
+
module Cloud
|
|
23
|
+
module DataQnA
|
|
24
|
+
module V1alpha
|
|
25
|
+
module AutoSuggestionService
|
|
26
|
+
module Rest
|
|
27
|
+
##
|
|
28
|
+
# REST service stub for the AutoSuggestionService service.
|
|
29
|
+
# Service stub contains baseline method implementations
|
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
|
31
|
+
#
|
|
32
|
+
class ServiceStub
|
|
33
|
+
# @private
|
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
|
35
|
+
# These require statements are intentionally placed here to initialize
|
|
36
|
+
# the REST modules only when it's required.
|
|
37
|
+
require "gapic/rest"
|
|
38
|
+
|
|
39
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
|
40
|
+
endpoint_template: endpoint_template,
|
|
41
|
+
universe_domain: universe_domain,
|
|
42
|
+
credentials: credentials,
|
|
43
|
+
numeric_enums: false,
|
|
44
|
+
service_name: self.class,
|
|
45
|
+
raise_faraday_errors: false,
|
|
46
|
+
logger: logger
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
##
|
|
50
|
+
# The effective universe domain
|
|
51
|
+
#
|
|
52
|
+
# @return [String]
|
|
53
|
+
#
|
|
54
|
+
def universe_domain
|
|
55
|
+
@client_stub.universe_domain
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
##
|
|
59
|
+
# The effective endpoint
|
|
60
|
+
#
|
|
61
|
+
# @return [String]
|
|
62
|
+
#
|
|
63
|
+
def endpoint
|
|
64
|
+
@client_stub.endpoint
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
##
|
|
68
|
+
# The logger used for request/response debug logging.
|
|
69
|
+
#
|
|
70
|
+
# @return [Logger]
|
|
71
|
+
#
|
|
72
|
+
def logger stub: false
|
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
##
|
|
77
|
+
# Baseline implementation for the suggest_queries REST call
|
|
78
|
+
#
|
|
79
|
+
# @param request_pb [::Google::Cloud::DataQnA::V1alpha::SuggestQueriesRequest]
|
|
80
|
+
# A request object representing the call parameters. Required.
|
|
81
|
+
# @param options [::Gapic::CallOptions]
|
|
82
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
83
|
+
#
|
|
84
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
85
|
+
# @yieldparam result [::Google::Cloud::DataQnA::V1alpha::SuggestQueriesResponse]
|
|
86
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
87
|
+
#
|
|
88
|
+
# @return [::Google::Cloud::DataQnA::V1alpha::SuggestQueriesResponse]
|
|
89
|
+
# A result object deserialized from the server's reply
|
|
90
|
+
def suggest_queries request_pb, options = nil
|
|
91
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
92
|
+
|
|
93
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_suggest_queries_request request_pb
|
|
94
|
+
query_string_params = if query_string_params.any?
|
|
95
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
96
|
+
else
|
|
97
|
+
{}
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
response = @client_stub.make_http_request(
|
|
101
|
+
verb,
|
|
102
|
+
uri: uri,
|
|
103
|
+
body: body || "",
|
|
104
|
+
params: query_string_params,
|
|
105
|
+
method_name: "suggest_queries",
|
|
106
|
+
options: options
|
|
107
|
+
)
|
|
108
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
109
|
+
result = ::Google::Cloud::DataQnA::V1alpha::SuggestQueriesResponse.decode_json response.body, ignore_unknown_fields: true
|
|
110
|
+
catch :response do
|
|
111
|
+
yield result, operation if block_given?
|
|
112
|
+
result
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
##
|
|
117
|
+
# @private
|
|
118
|
+
#
|
|
119
|
+
# GRPC transcoding helper method for the suggest_queries REST call
|
|
120
|
+
#
|
|
121
|
+
# @param request_pb [::Google::Cloud::DataQnA::V1alpha::SuggestQueriesRequest]
|
|
122
|
+
# A request object representing the call parameters. Required.
|
|
123
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
124
|
+
# Uri, Body, Query string parameters
|
|
125
|
+
def self.transcode_suggest_queries_request request_pb
|
|
126
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
127
|
+
.with_bindings(
|
|
128
|
+
uri_method: :post,
|
|
129
|
+
uri_template: "/v1alpha/{parent}:suggestQueries",
|
|
130
|
+
body: "*",
|
|
131
|
+
matches: [
|
|
132
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
|
|
133
|
+
]
|
|
134
|
+
)
|
|
135
|
+
transcoder.transcode request_pb
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
require "gapic/rest"
|
|
20
|
+
require "gapic/config"
|
|
21
|
+
require "gapic/config/method"
|
|
22
|
+
|
|
23
|
+
require "google/cloud/dataqna/v1alpha/version"
|
|
24
|
+
|
|
25
|
+
require "google/cloud/dataqna/v1alpha/auto_suggestion_service/credentials"
|
|
26
|
+
require "google/cloud/dataqna/v1alpha/auto_suggestion_service/paths"
|
|
27
|
+
require "google/cloud/dataqna/v1alpha/auto_suggestion_service/rest/client"
|
|
28
|
+
|
|
29
|
+
module Google
|
|
30
|
+
module Cloud
|
|
31
|
+
module DataQnA
|
|
32
|
+
module V1alpha
|
|
33
|
+
##
|
|
34
|
+
# This stateless API provides automatic suggestions for natural language
|
|
35
|
+
# queries for the data sources in the provided project and location.
|
|
36
|
+
#
|
|
37
|
+
# The service provides a resourceless operation `suggestQueries` that can be
|
|
38
|
+
# called to get a list of suggestions for a given incomplete query and scope
|
|
39
|
+
# (or list of scopes) under which the query is to be interpreted.
|
|
40
|
+
#
|
|
41
|
+
# There are two types of suggestions, ENTITY for single entity suggestions
|
|
42
|
+
# and TEMPLATE for full sentences. By default, both types are returned.
|
|
43
|
+
#
|
|
44
|
+
# Example Request:
|
|
45
|
+
# ```
|
|
46
|
+
# GetSuggestions({
|
|
47
|
+
# parent: "locations/us/projects/my-project"
|
|
48
|
+
# scopes:
|
|
49
|
+
# "//bigquery.googleapis.com/projects/my-project/datasets/my-dataset/tables/my-table"
|
|
50
|
+
# query: "top it"
|
|
51
|
+
# })
|
|
52
|
+
# ```
|
|
53
|
+
#
|
|
54
|
+
# The service will retrieve information based on the given scope(s) and give
|
|
55
|
+
# suggestions based on that (e.g. "top item" for "top it" if "item" is a known
|
|
56
|
+
# dimension for the provided scope).
|
|
57
|
+
# ```
|
|
58
|
+
# suggestions {
|
|
59
|
+
# suggestion_info {
|
|
60
|
+
# annotated_suggestion {
|
|
61
|
+
# text_formatted: "top item by sum of usd_revenue_net"
|
|
62
|
+
# markups {
|
|
63
|
+
# type: DIMENSION
|
|
64
|
+
# start_char_index: 4
|
|
65
|
+
# length: 4
|
|
66
|
+
# }
|
|
67
|
+
# markups {
|
|
68
|
+
# type: METRIC
|
|
69
|
+
# start_char_index: 19
|
|
70
|
+
# length: 15
|
|
71
|
+
# }
|
|
72
|
+
# }
|
|
73
|
+
# query_matches {
|
|
74
|
+
# start_char_index: 0
|
|
75
|
+
# length: 6
|
|
76
|
+
# }
|
|
77
|
+
# }
|
|
78
|
+
# suggestion_type: TEMPLATE
|
|
79
|
+
# ranking_score: 0.9
|
|
80
|
+
# }
|
|
81
|
+
# suggestions {
|
|
82
|
+
# suggestion_info {
|
|
83
|
+
# annotated_suggestion {
|
|
84
|
+
# text_formatted: "item"
|
|
85
|
+
# markups {
|
|
86
|
+
# type: DIMENSION
|
|
87
|
+
# start_char_index: 4
|
|
88
|
+
# length: 2
|
|
89
|
+
# }
|
|
90
|
+
# }
|
|
91
|
+
# query_matches {
|
|
92
|
+
# start_char_index: 0
|
|
93
|
+
# length: 6
|
|
94
|
+
# }
|
|
95
|
+
# }
|
|
96
|
+
# suggestion_type: ENTITY
|
|
97
|
+
# ranking_score: 0.8
|
|
98
|
+
# }
|
|
99
|
+
# ```
|
|
100
|
+
#
|
|
101
|
+
# To load this service and instantiate a REST client:
|
|
102
|
+
#
|
|
103
|
+
# require "google/cloud/dataqna/v1alpha/auto_suggestion_service/rest"
|
|
104
|
+
# client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Rest::Client.new
|
|
105
|
+
#
|
|
106
|
+
module AutoSuggestionService
|
|
107
|
+
# Client for the REST transport
|
|
108
|
+
module Rest
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
|
117
|
+
require "google/cloud/dataqna/v1alpha/auto_suggestion_service/rest/helpers" if ::File.file? helper_path
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 Google LLC
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -25,6 +25,7 @@ require "google/cloud/dataqna/v1alpha/version"
|
|
|
25
25
|
require "google/cloud/dataqna/v1alpha/auto_suggestion_service/credentials"
|
|
26
26
|
require "google/cloud/dataqna/v1alpha/auto_suggestion_service/paths"
|
|
27
27
|
require "google/cloud/dataqna/v1alpha/auto_suggestion_service/client"
|
|
28
|
+
require "google/cloud/dataqna/v1alpha/auto_suggestion_service/rest"
|
|
28
29
|
|
|
29
30
|
module Google
|
|
30
31
|
module Cloud
|
|
@@ -103,6 +104,11 @@ module Google
|
|
|
103
104
|
# require "google/cloud/dataqna/v1alpha/auto_suggestion_service"
|
|
104
105
|
# client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new
|
|
105
106
|
#
|
|
107
|
+
# @example Load this service and instantiate a REST client
|
|
108
|
+
#
|
|
109
|
+
# require "google/cloud/dataqna/v1alpha/auto_suggestion_service/rest"
|
|
110
|
+
# client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Rest::Client.new
|
|
111
|
+
#
|
|
106
112
|
module AutoSuggestionService
|
|
107
113
|
end
|
|
108
114
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
2
|
# Source: google/cloud/dataqna/v1alpha/auto_suggestion_service.proto for package 'Google.Cloud.DataQnA.V1alpha'
|
|
3
3
|
# Original file comments:
|
|
4
|
-
# Copyright
|
|
4
|
+
# Copyright 2025 Google LLC
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|