Context class

Dialogflow contexts are similar to natural language context.

If a person says to you "they are orange", you need context in order to understand what "they" is referring to. Similarly, for Dialogflow to handle an end-user expression like that, it needs to be provided with context in order to correctly match an intent.

Using contexts, you can control the flow of a conversation.

You can configure contexts for an intent by setting input and output contexts, which are identified by string names. When an intent is matched, any configured output contexts for that intent become active. While any contexts are active, Dialogflow is more likely to match intents that are configured with input contexts that correspond to the currently active contexts.

For more information about context, see the Context.

Annotations
  • @JsonSerializable()

Constructors

Context({String? name, int? lifespanCount, Map<String, dynamic>? parameters})
Dialogflow contexts are similar to natural language context.
Context.fromJson(Map<String, dynamic> json)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
lifespanCount int?
The number of conversational query requests after which the context expires. The default is 0.
final
name String?
The unique identifier of the context.
final
parameters Map<String, dynamic>?
This is a map of extracted parameters (MapKey, MapValue) pairs:
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited