pub struct Conversations { /* private fields */ }conversations only.Expand description
Implements a client for the Dialogflow API.
§Example
let client = Conversations::builder().build().await?;
// use `client` to make requests to the Dialogflow API.§Service Description
Service for managing Conversations.
§Configuration
To configure Conversations use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://dialogflow.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
Conversations holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap Conversations in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl Conversations
impl Conversations
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for Conversations.
let client = Conversations::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Conversations + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Conversations + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_conversation(&self) -> CreateConversation
pub fn create_conversation(&self) -> CreateConversation
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there’s no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If
Conversation.conversation_profile
is configured for a dialogflow agent, conversation will start from
Automated Agent Stage, otherwise, it will start from Assist Stage. And
during Automated Agent Stage, once an
Intent with
Intent.live_agent_handoff
is triggered, conversation will transfer to Assist Stage.
Sourcepub fn list_conversations(&self) -> ListConversations
pub fn list_conversations(&self) -> ListConversations
Returns the list of all conversations in the specified project.
Sourcepub fn get_conversation(&self) -> GetConversation
pub fn get_conversation(&self) -> GetConversation
Retrieves the specific conversation.
Sourcepub fn complete_conversation(&self) -> CompleteConversation
pub fn complete_conversation(&self) -> CompleteConversation
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Sourcepub fn ingest_context_references(&self) -> IngestContextReferences
pub fn ingest_context_references(&self) -> IngestContextReferences
Data ingestion API. Ingests context references for an existing conversation.
Sourcepub fn list_messages(&self) -> ListMessages
pub fn list_messages(&self) -> ListMessages
Lists messages that belong to a given conversation.
messages are ordered by create_time in descending order. To fetch
updates without duplication, send request with filter
create_time_epoch_microseconds > [first item's create_time of previous request] and empty page_token.
Sourcepub fn suggest_conversation_summary(&self) -> SuggestConversationSummary
pub fn suggest_conversation_summary(&self) -> SuggestConversationSummary
Suggests summary for a conversation based on specific historical messages. The range of the messages to be used for summary can be specified in the request.
Sourcepub fn generate_stateless_summary(&self) -> GenerateStatelessSummary
pub fn generate_stateless_summary(&self) -> GenerateStatelessSummary
Generates and returns a summary for a conversation that does not have a resource created for it.
Sourcepub fn generate_stateless_suggestion(&self) -> GenerateStatelessSuggestion
pub fn generate_stateless_suggestion(&self) -> GenerateStatelessSuggestion
Generates and returns a suggestion for a conversation that does not have a resource created for it.
Sourcepub fn search_knowledge(&self) -> SearchKnowledge
pub fn search_knowledge(&self) -> SearchKnowledge
Get answers for the given query based on knowledge documents.
Sourcepub fn generate_suggestions(&self) -> GenerateSuggestions
pub fn generate_suggestions(&self) -> GenerateSuggestions
Generates all the suggestions using generators configured in the conversation profile. A generator is used only if its trigger event is matched.
Sourcepub fn list_locations(&self) -> ListLocations
pub fn list_locations(&self) -> ListLocations
Lists information about the supported locations for this service.
Sourcepub fn get_location(&self) -> GetLocation
pub fn get_location(&self) -> GetLocation
Gets information about a location.
Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for Conversations
impl Clone for Conversations
Source§fn clone(&self) -> Conversations
fn clone(&self) -> Conversations
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more