pub struct ContextsClient<T> { /* private fields */ }
Expand description
A context represents additional information included with user input or with an intent returned by the Dialogflow API. Contexts are helpful for differentiating user input which may be vague or have a different meaning depending on additional details from your application such as user setting and preferences, previous user input, where the user is in your application, geographic location, and so on.
You can include contexts as input parameters of a
[DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] (or
[StreamingDetectIntent][google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntent]) request,
or as output contexts included in the returned intent.
Contexts expire when an intent is matched, after the number of DetectIntent
requests specified by the lifespan_count
parameter, or after 20 minutes
if no intents are matched for a DetectIntent
request.
For more information about contexts, see the Dialogflow documentation.
Implementations§
Source§impl<T> ContextsClient<T>where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
impl<T> ContextsClient<T>where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_interceptor(inner: T, interceptor: impl Into<Interceptor>) -> Self
Sourcepub async fn list_contexts(
&mut self,
request: impl IntoRequest<ListContextsRequest>,
) -> Result<Response<ListContextsResponse>, Status>
pub async fn list_contexts( &mut self, request: impl IntoRequest<ListContextsRequest>, ) -> Result<Response<ListContextsResponse>, Status>
Returns the list of all contexts in the specified session.
Sourcepub async fn get_context(
&mut self,
request: impl IntoRequest<GetContextRequest>,
) -> Result<Response<Context>, Status>
pub async fn get_context( &mut self, request: impl IntoRequest<GetContextRequest>, ) -> Result<Response<Context>, Status>
Retrieves the specified context.
Sourcepub async fn create_context(
&mut self,
request: impl IntoRequest<CreateContextRequest>,
) -> Result<Response<Context>, Status>
pub async fn create_context( &mut self, request: impl IntoRequest<CreateContextRequest>, ) -> Result<Response<Context>, Status>
Creates a context.
If the specified context already exists, overrides the context.
Sourcepub async fn update_context(
&mut self,
request: impl IntoRequest<UpdateContextRequest>,
) -> Result<Response<Context>, Status>
pub async fn update_context( &mut self, request: impl IntoRequest<UpdateContextRequest>, ) -> Result<Response<Context>, Status>
Updates the specified context.
Sourcepub async fn delete_context(
&mut self,
request: impl IntoRequest<DeleteContextRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_context( &mut self, request: impl IntoRequest<DeleteContextRequest>, ) -> Result<Response<()>, Status>
Deletes the specified context.
Sourcepub async fn delete_all_contexts(
&mut self,
request: impl IntoRequest<DeleteAllContextsRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_all_contexts( &mut self, request: impl IntoRequest<DeleteAllContextsRequest>, ) -> Result<Response<()>, Status>
Deletes all active contexts in the specified session.
Trait Implementations§
Source§impl<T: Clone> Clone for ContextsClient<T>
impl<T: Clone> Clone for ContextsClient<T>
Auto Trait Implementations§
impl<T> Freeze for ContextsClient<T>where
T: Freeze,
impl<T> !RefUnwindSafe for ContextsClient<T>
impl<T> Send for ContextsClient<T>where
T: Send,
impl<T> Sync for ContextsClient<T>where
T: Sync,
impl<T> Unpin for ContextsClient<T>where
T: Unpin,
impl<T> !UnwindSafe for ContextsClient<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request