Reference documentation and code samples for the BigQuery Data QnA V1alpha API class Google::Cloud::DataQnA::V1alpha::QuestionService::Client.
Client for the QuestionService service.
Service to interpret natural language queries.
The service allows to create Question
resources that are interpreted and
are filled with one or more interpretations if the question could be
interpreted. Once a Question
resource is created and has at least one
interpretation, an interpretation can be chosen for execution, which
triggers a query to the backend (for BigQuery, it will create a job).
Upon successful execution of that interpretation, backend specific
information will be returned so that the client can retrieve the results
from the backend.
The Question
resources are named projects//locations//questions/*
.
The Question
resource has a singletion sub-resource UserFeedback
named
projects//locations//questions/*/userFeedback
, which allows access to
user feedback.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the QuestionService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all QuestionService clients ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the QuestionService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_question
def create_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
def create_question(parent: nil, question: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
Creates a question.
def create_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
create_question
via a request object, either of type
CreateQuestionRequest or an equivalent Hash.
- request (::Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_question(parent: nil, question: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
create_question
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).
-
parent (::String) — Required. The name of the project this data source reference belongs to.
Example:
projects/foo/locations/bar
- question (::Google::Cloud::DataQnA::V1alpha::Question, ::Hash) — Required. The question to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DataQnA::V1alpha::Question)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dataqna/v1alpha" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest.new # Call the create_question method. result = client.create_question request # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. p result
#execute_question
def execute_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
def execute_question(name: nil, interpretation_index: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
Executes an interpretation.
def execute_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
execute_question
via a request object, either of type
ExecuteQuestionRequest or an equivalent Hash.
- request (::Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def execute_question(name: nil, interpretation_index: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
execute_question
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).
-
name (::String) — Required. The unique identifier for the question.
Example:
projects/foo/locations/bar/questions/1234
- interpretation_index (::Integer) — Required. Index of the interpretation to execute.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DataQnA::V1alpha::Question)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dataqna/v1alpha" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest.new # Call the execute_question method. result = client.execute_question request # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. p result
#get_question
def get_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
def get_question(name: nil, read_mask: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
Gets a previously created question.
def get_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
get_question
via a request object, either of type
GetQuestionRequest or an equivalent Hash.
- request (::Google::Cloud::DataQnA::V1alpha::GetQuestionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_question(name: nil, read_mask: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
get_question
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).
-
name (::String) — Required. The unique identifier for the question.
Example:
projects/foo/locations/bar/questions/1234
- read_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be retrieved.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DataQnA::V1alpha::Question)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dataqna/v1alpha" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DataQnA::V1alpha::GetQuestionRequest.new # Call the get_question method. result = client.get_question request # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. p result
#get_user_feedback
def get_user_feedback(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
def get_user_feedback(name: nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
Gets previously created user feedback.
def get_user_feedback(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
get_user_feedback
via a request object, either of type
GetUserFeedbackRequest or an equivalent Hash.
- request (::Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_user_feedback(name: nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
get_user_feedback
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).
-
name (::String) — Required. The unique identifier for the user feedback.
User feedback is a singleton resource on a Question.
Example:
projects/foo/locations/bar/questions/1234/userFeedback
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DataQnA::V1alpha::UserFeedback)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dataqna/v1alpha" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest.new # Call the get_user_feedback method. result = client.get_user_feedback request # The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new QuestionService client object.
- (config) — Configure the QuestionService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config| config.timeout = 10.0 end
#update_user_feedback
def update_user_feedback(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
def update_user_feedback(user_feedback: nil, update_mask: nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
Updates user feedback. This creates user feedback if there was none before (upsert).
def update_user_feedback(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
update_user_feedback
via a request object, either of type
UpdateUserFeedbackRequest or an equivalent Hash.
- request (::Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_user_feedback(user_feedback: nil, update_mask: nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
update_user_feedback
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).
- user_feedback (::Google::Cloud::DataQnA::V1alpha::UserFeedback, ::Hash) — Required. The user feedback to update. This can be called even if there is no user feedback so far. The feedback's name field is used to identify the user feedback (and the corresponding question) to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DataQnA::V1alpha::UserFeedback)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dataqna/v1alpha" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest.new # Call the update_user_feedback method. result = client.update_user_feedback request # The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback. p result