Class ConversationalSearchServiceClient (2.24.0)

Service for conversational search.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

ConversationalSearchServiceClient(ConversationalSearchServiceClient const &)

Copy and move support

Parameter
Name Description
ConversationalSearchServiceClient const &

ConversationalSearchServiceClient(ConversationalSearchServiceClient &&)

Copy and move support

Parameter
Name Description
ConversationalSearchServiceClient &&

ConversationalSearchServiceClient(std::shared_ptr< ConversationalSearchServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< ConversationalSearchServiceConnection >
opts Options

Operators

operator=(ConversationalSearchServiceClient const &)

Copy and move support

Parameter
Name Description
ConversationalSearchServiceClient const &
Returns
Type Description
ConversationalSearchServiceClient &

operator=(ConversationalSearchServiceClient &&)

Copy and move support

Parameter
Name Description
ConversationalSearchServiceClient &&
Returns
Type Description
ConversationalSearchServiceClient &

Functions

ConverseConversation(std::string const &, google::cloud::discoveryengine::v1::TextInput const &, Options)

Converses a conversation.

Parameters
Name Description
name std::string const &

Required. The resource name of the Conversation to get. Format: projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}. Use projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/- to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.

query google::cloud::discoveryengine::v1::TextInput const &

Required. Current user input.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::discoveryengine::v1::ConverseConversationResponse >

the result of the RPC. The response message type (google.cloud.discoveryengine.v1.ConverseConversationResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ConverseConversation(google::cloud::discoveryengine::v1::ConverseConversationRequest const &, Options)

Converses a conversation.

Parameters
Name Description
request google::cloud::discoveryengine::v1::ConverseConversationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.discoveryengine.v1.ConverseConversationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::discoveryengine::v1::ConverseConversationResponse >

the result of the RPC. The response message type (google.cloud.discoveryengine.v1.ConverseConversationResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateConversation(std::string const &, google::cloud::discoveryengine::v1::Conversation const &, Options)

Creates a Conversation.

If the Conversation to create already exists, an ALREADY_EXISTS error is returned.

Parameters
Name Description
parent std::string const &

Required. Full resource name of parent data store. Format: projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}

conversation google::cloud::discoveryengine::v1::Conversation const &

Required. The conversation to create.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::discoveryengine::v1::Conversation >

the result of the RPC. The response message type (google.cloud.discoveryengine.v1.Conversation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateConversation(google::cloud::discoveryengine::v1::CreateConversationRequest const &, Options)

Creates a Conversation.

If the Conversation to create already exists, an ALREADY_EXISTS error is returned.

Parameters
Name Description
request google::cloud::discoveryengine::v1::CreateConversationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.discoveryengine.v1.CreateConversationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::discoveryengine::v1::Conversation >

the result of the RPC. The response message type (google.cloud.discoveryengine.v1.Conversation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeleteConversation(std::string const &, Options)

Deletes a Conversation.

If the Conversation to delete does not exist, a NOT_FOUND error is returned.

Parameters
Name Description
name std::string const &

Required. The resource name of the Conversation to delete. Format: projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteConversation(google::cloud::discoveryengine::v1::DeleteConversationRequest const &, Options)

Deletes a Conversation.

If the Conversation to delete does not exist, a NOT_FOUND error is returned.

Parameters
Name Description
request google::cloud::discoveryengine::v1::DeleteConversationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.discoveryengine.v1.DeleteConversationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

UpdateConversation(google::cloud::discoveryengine::v1::Conversation const &, google::protobuf::FieldMask const &, Options)

Updates a Conversation.

Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.

Parameters
Name Description
conversation google::cloud::discoveryengine::v1::Conversation const &

Required. The Conversation to update.

update_mask google::protobuf::FieldMask const &

Indicates which fields in the provided Conversation to update. The following are NOT supported:

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::discoveryengine::v1::Conversation >

the result of the RPC. The response message type (google.cloud.discoveryengine.v1.Conversation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateConversation(google::cloud::discoveryengine::v1::UpdateConversationRequest const &, Options)

Updates a Conversation.

Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.

Parameters
Name Description
request google::cloud::discoveryengine::v1::UpdateConversationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.discoveryengine.v1.UpdateConversationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::discoveryengine::v1::Conversation >

the result of the RPC. The response message type (google.cloud.discoveryengine.v1.Conversation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetConversation(std::string const &, Options)

Gets a Conversation.

Parameters
Name Description
name std::string const &

Required. The resource name of the Conversation to get. Format: projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::discoveryengine::v1::Conversation >

the result of the RPC. The response message type (google.cloud.discoveryengine.v1.Conversation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetConversation(google::cloud::discoveryengine::v1::GetConversationRequest const &, Options)

Gets a Conversation.

Parameters
Name Description
request google::cloud::discoveryengine::v1::GetConversationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.discoveryengine.v1.GetConversationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::discoveryengine::v1::Conversation >

the result of the RPC. The response message type (google.cloud.discoveryengine.v1.Conversation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListConversations(std::string const &, Options)

Lists all Conversations by their parent [DataStore][google.cloud.discoveryengine.v1.DataStore].

Parameters
Name Description
parent std::string const &

Required. The data store resource name. Format: projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::discoveryengine::v1::Conversation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.discoveryengine.v1.Conversation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListConversations(google::cloud::discoveryengine::v1::ListConversationsRequest, Options)

Lists all Conversations by their parent [DataStore][google.cloud.discoveryengine.v1.DataStore].

Parameters
Name Description
request google::cloud::discoveryengine::v1::ListConversationsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.discoveryengine.v1.ListConversationsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::discoveryengine::v1::Conversation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.discoveryengine.v1.Conversation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.