pub struct Flow {
pub name: String,
pub display_name: String,
pub description: String,
pub transition_routes: Vec<TransitionRoute>,
pub event_handlers: Vec<EventHandler>,
pub transition_route_groups: Vec<String>,
pub nlu_settings: Option<NluSettings>,
}
Expand description
Flows represents the conversation flows when you build your chatbot agent.
A flow consists of many pages connected by the transition routes. Conversations always start with the built-in Start Flow (with an all-0 ID). Transition routes can direct the conversation session from the current flow (parent flow) to another flow (sub flow). When the sub flow is finished, Dialogflow will bring the session back to the parent flow, where the sub flow is started.
Usually, when a transition route is followed by a matched intent, the intent will be “consumed”. This means the intent won’t activate more transition routes. However, when the followed transition route moves the conversation session into a different flow, the matched intent can be carried over and to be consumed in the target flow.
Fields
name: String
The unique identifier of the flow.
Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>
.
display_name: String
Required. The human-readable name of the flow.
description: String
The description of the flow. The maximum length is 500 characters. If exceeded, the request is rejected.
transition_routes: Vec<TransitionRoute>
A flow’s transition routes serve two purposes:
- They are responsible for matching the user’s first utterances in the flow.
- They are inherited by every page’s [transition routes][Page.transition_routes] and can support use cases such as the user saying “help” or “can I talk to a human?”, which can be handled in a common way regardless of the current page. Transition routes defined in the page have higher priority than those defined in the flow.
TransitionRoutes are evalauted in the following order:
- TransitionRoutes with intent specified..
- TransitionRoutes with only condition specified.
TransitionRoutes with intent specified are inherited by pages in the flow.
event_handlers: Vec<EventHandler>
A flow’s event handlers serve two purposes:
- They are responsible for handling events (e.g. no match, webhook errors) in the flow.
- They are inherited by every page’s [event handlers][Page.event_handlers], which can be used to handle common events regardless of the current page. Event handlers defined in the page have higher priority than those defined in the flow.
Unlike [transition_routes][google.cloud.dialogflow.cx.v3.Flow.transition_routes], these handlers are evaluated on a first-match basis. The first one that matches the event get executed, with the rest being ignored.
transition_route_groups: Vec<String>
A flow’s transition route group serve two purposes:
- They are responsible for matching the user’s first utterances in the flow.
- They are inherited by every page’s [transition route groups][Page.transition_route_groups]. Transition route groups defined in the page have higher priority than those defined in the flow.
Format:projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>
.
nlu_settings: Option<NluSettings>
NLU related settings of the flow.
Trait Implementations
sourceimpl Message for Flow
impl Message for Flow
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
sourcefn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
Encodes the message to a buffer. Read more
sourcefn encode_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Encodes the message to a newly allocated buffer.
sourcefn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
Encodes the message with a length-delimiter to a buffer. Read more
sourcefn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Encodes the message with a length-delimiter to a newly allocated buffer.
sourcefn decode<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
Decodes an instance of the message from a buffer. Read more
sourcefn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
sourcefn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
Decodes an instance of the message from a buffer, and merges it into self
. Read more
sourcefn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
sourceimpl PartialEq<Flow> for Flow
impl PartialEq<Flow> for Flow
impl StructuralPartialEq for Flow
Auto Trait Implementations
impl RefUnwindSafe for Flow
impl Send for Flow
impl Sync for Flow
impl Unpin for Flow
impl UnwindSafe for Flow
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request