Discovery Engine V1BETA API - Class Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Rest::Client (v0.28.0)

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::Configuration

Configure the AssistantService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# 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::Configuration

Configure 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#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::Assistant

Creates an Assistant.

Overloads
def create_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistant
Pass arguments to create_assistant via a request object, either of type CreateAssistantRequest or an equivalent Hash.
Parameters
  • 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::Assistant
Pass arguments to create_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).
Parameters
  • 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.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Empty

Deletes an Assistant.

Overloads
def delete_assistant(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_assistant via a request object, either of type DeleteAssistantRequest or an equivalent Hash.
Parameters
  • 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::Empty
Pass arguments to delete_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).
Parameter
  • 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.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Assistant

Gets an Assistant.

Overloads
def get_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistant
Pass arguments to get_assistant via a request object, either of type GetAssistantRequest or an equivalent Hash.
Parameters
  • 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::Assistant
Pass arguments to get_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).
Parameter
  • name (::String) — Required. Resource name of Assistant. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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| ... } -> Client

Create a new AssistantService REST client object.

Yields
  • (config) — Configure the AssistantService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# 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.

Overloads
def list_assistants(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Assistant>
Pass arguments to list_assistants via a request object, either of type ListAssistantsRequest or an equivalent Hash.
Parameters
  • 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>
Pass arguments to 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).
Parameters
  • 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.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (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.

Overloads
def stream_assist(request, options = nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::StreamAssistResponse>
Pass arguments to stream_assist via a request object, either of type StreamAssistRequest or an equivalent Hash.
Parameters
  • 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>
Pass arguments to 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).
Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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() -> String

The effective universe domain

Returns
  • (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::Assistant

Updates an Assistant

Overloads
def update_assistant(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Assistant
Pass arguments to update_assistant via a request object, either of type UpdateAssistantRequest or an equivalent Hash.
Parameters
  • 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::Assistant
Pass arguments to update_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).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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