Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.
REST client for the AssistantService service.
Service for managing Assistant configuration and assisting users.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the AssistantService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all AssistantService clients ::Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the AssistantService 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_assistant
def create_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistant
def create_assistant(parent: nil, assistant: nil, assistant_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::AssistantCreates an Assistant.
def create_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistantcreate_assistant via a request object, either of type
CreateAssistantRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::CreateAssistantRequest, ::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_assistant(parent: nil, assistant: nil, assistant_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistantcreate_assistant 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 parent resource name.
Format:
projects/{project}/locations/{location}/collections/{collection}/engines/{engine} - assistant (::Google::Cloud::DiscoveryEngine::V1beta::Assistant, ::Hash) — Required. The Assistant to create.
-
assistant_id (::String) — Required. The ID to use for the
Assistant, which will
become the final component of the
Assistant's resource name.
This field must conform to RFC-1034 with a length limit of 63 characters.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DiscoveryEngine::V1beta::Assistant)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::CreateAssistantRequest.new # Call the create_assistant method. result = client.create_assistant request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Assistant. p result
#delete_assistant
def delete_assistant(request, options = nil) -> ::Google::Protobuf::Empty
def delete_assistant(name: nil) -> ::Google::Protobuf::EmptyDeletes an Assistant.
def delete_assistant(request, options = nil) -> ::Google::Protobuf::Emptydelete_assistant via a request object, either of type
DeleteAssistantRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::DeleteAssistantRequest, ::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 delete_assistant(name: nil) -> ::Google::Protobuf::Emptydelete_assistant 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. Resource name of
Assistant. Format:
projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}If the caller does not have permission to delete the Assistant, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the Assistant to delete does not exist, a NOT_FOUND error is returned.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::DeleteAssistantRequest.new # Call the delete_assistant method. result = client.delete_assistant request # The returned object is of type Google::Protobuf::Empty. p result
#get_assistant
def get_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistant
def get_assistant(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::AssistantGets an Assistant.
def get_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistantget_assistant via a request object, either of type
GetAssistantRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::GetAssistantRequest, ::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_assistant(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistantget_assistant 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. Resource name of
Assistant. Format:
projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DiscoveryEngine::V1beta::Assistant)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::GetAssistantRequest.new # Call the get_assistant method. result = client.get_assistant request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Assistant. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new AssistantService REST client object.
- (config) — Configure the AssistantService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_assistants
def list_assistants(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Assistant>
def list_assistants(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Assistant>Lists all {::Google::Cloud::DiscoveryEngine::V1beta::Assistant Assistant}s under an Engine.
def list_assistants(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Assistant>list_assistants via a request object, either of type
ListAssistantsRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::ListAssistantsRequest, ::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 list_assistants(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Assistant>list_assistants 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 parent resource name.
Format:
projects/{project}/locations/{location}/collections/{collection}/engines/{engine} - page_size (::Integer) — Maximum number of {::Google::Cloud::DiscoveryEngine::V1beta::Assistant Assistant}s to return. If unspecified, defaults to 100. The maximum allowed value is 1000; anything above that will be coerced down to 1000.
-
page_token (::String) — A page token
ListAssistantsResponse.next_page_token,
received from a previous
AssistantService.ListAssistants
call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to ListAssistants must match the call that provided the page token.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Assistant>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Assistant>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::ListAssistantsRequest.new # Call the list_assistants method. result = client.list_assistants request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Assistant. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#stream_assist
def stream_assist(request, options = nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistResponse>
def stream_assist(name: nil, query: nil, session: nil, user_metadata: nil, tools_spec: nil, generation_spec: nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistResponse>Assists the user with a query in a streaming fashion.
def stream_assist(request, options = nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistResponse>stream_assist via a request object, either of type
StreamAssistRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistRequest, ::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 stream_assist(name: nil, query: nil, session: nil, user_metadata: nil, tools_spec: nil, generation_spec: nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistResponse>stream_assist 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 resource name of the
Assistant. Format:
projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant} -
query (::Google::Cloud::DiscoveryEngine::V1beta::Query, ::Hash) — Optional. Current user query.
Empty query is only supported if
file_idsare provided. In this case, the answer will be generated based on those context files. -
session (::String) — Optional. The session to use for the request. If specified, the assistant
has access to the session history, and the query and the answer are stored
there.
If
-is specified as the session ID, or it is left empty, then a new session is created with an automatically generated ID.Format:
projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session} - user_metadata (::Google::Cloud::DiscoveryEngine::V1beta::AssistUserMetadata, ::Hash) — Optional. Information about the user initiating the query.
- tools_spec (::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistRequest::ToolsSpec, ::Hash) — Optional. Specification of tools that are used to serve the request.
- generation_spec (::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistRequest::GenerationSpec, ::Hash) — Optional. Specification of the generation configuration for the request.
- (::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistResponse>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::StreamAssistRequest.new # Call the stream_assist method to start streaming. output = client.stream_assist request # The returned object is a streamed enumerable yielding elements of type # ::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistResponse output.each do |current_response| p current_response end
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_assistant
def update_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistant
def update_assistant(assistant: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::AssistantUpdates an Assistant
def update_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistantupdate_assistant via a request object, either of type
UpdateAssistantRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::UpdateAssistantRequest, ::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_assistant(assistant: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistantupdate_assistant 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).
-
assistant (::Google::Cloud::DiscoveryEngine::V1beta::Assistant, ::Hash) — Required. The Assistant to
update.
The Assistant's
namefield is used to identify the Assistant to update. Format:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}If the caller does not have permission to update the Assistant, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the Assistant to update does not exist, a NOT_FOUND error is returned.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to update.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DiscoveryEngine::V1beta::Assistant)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::UpdateAssistantRequest.new # Call the update_assistant method. result = client.update_assistant request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Assistant. p result