public class DialogState
The class Dialog state.
class Dialogpublic DialogState(@Nullable
Intent currentIntent,
@NotNull
java.util.Map<java.lang.String,ai.tock.bot.engine.dialog.EntityStateValue> entityValues,
@NotNull
java.util.Map<java.lang.String,java.lang.Object> context,
@Nullable
UserLocation userLocation,
@Nullable
NextUserActionState nextActionState)
The class Dialog state.
currentIntent - The current class Intent of the dialog, can be null.entityValues - The current entity values (with their history).context - The context of the dialog, a versatile map.userLocation - The current class UserLocation if any.nextActionState - The class NextUserActionState if any.If not null, it will be applied to the next user action, with NLP custom qualifiers.class Dialogpublic DialogState()
The class Dialog state.
class Dialogpublic void setContextValue(@NotNull
java.lang.String name,
@Nullable
java.lang.Object value)
Updates persistent context value. Do not store Collection or Map in the context, only plain objects or typed arrays.
public void setValue(@NotNull
java.lang.String role,
@NotNull
EntityValue value)
Set a new entity value. Remove previous entity values history.
public void setValue(@NotNull
ai.tock.nlp.api.client.model.Entity entity,
@NotNull
ai.tock.nlp.entity.Value value)
Set a new entity value. Remove previous entity values history.
public void changeValue(@NotNull
ai.tock.nlp.api.client.model.Entity entity,
@Nullable
ai.tock.nlp.entity.Value newValue)
Change an entity value. Keep previous entity values history.
public void changeValue(@NotNull
EntityValue newValue)
Change an entity value. Keep previous entity values history.
public void changeValue(@NotNull
java.lang.String role,
@Nullable
EntityValue newValue)
Change an entity value. Keep previous entity values history.
public void resetAllEntityValues()
Reset all entity values. Keep entity values history.
public void resetValue(@NotNull
java.lang.String role)
Reset the value of an entity. Keep entity values history.
public void cleanupState()
Same than resetState but remove also entity values history.
resetStatepublic void resetState()
Reset all entity values, context values, userLocation and nextActionState but keep entity values history.
@Nullable public Intent getCurrentIntent()
The current
class Intent of the dialog, can be null.
class Intentpublic void setCurrentIntent(@Nullable
Intent p)
The current
class Intent of the dialog, can be null.
p - The current class Intent of the dialog, can be null.class Intent@NotNull public java.util.Map<java.lang.String,ai.tock.bot.engine.dialog.EntityStateValue> getEntityValues()
The current entity values
(with their history).
@NotNull public java.util.Map<java.lang.String,java.lang.Object> getContext()
The context of the dialog,
a versatile map.
@Nullable public UserLocation getUserLocation()
The current
class UserLocation if any.
class UserLocationpublic void setUserLocation(@Nullable
UserLocation p)
The current
class UserLocation if any.
p - The current class UserLocation if any.class UserLocation@Nullable public NextUserActionState getNextActionState()
The
class NextUserActionState if any.If not null, it will be applied to the next user action, with NLP custom qualifiers.
class NextUserActionStatepublic void setNextActionState(@Nullable
NextUserActionState p)
The
class NextUserActionState if any.If not null, it will be applied to the next user action, with NLP custom qualifiers.
p - The class NextUserActionState if any.If not null, it will be applied to the next user action, with NLP custom qualifiers.class NextUserActionState@Nullable public Intent component1()
The current
class Intent of the dialog, can be null.
class Intent@NotNull public java.util.Map<java.lang.String,ai.tock.bot.engine.dialog.EntityStateValue> component2()
The current entity values
(with their history).
@NotNull public java.util.Map<java.lang.String,java.lang.Object> component3()
The context of the dialog,
a versatile map.
@Nullable public UserLocation component4()
The current
class UserLocation if any.
class UserLocation@Nullable public NextUserActionState component5()
The
class NextUserActionState if any.If not null, it will be applied to the next user action, with NLP custom qualifiers.
class NextUserActionState@NotNull public DialogState copy(@Nullable Intent currentIntent, @NotNull java.util.Map<java.lang.String,ai.tock.bot.engine.dialog.EntityStateValue> entityValues, @NotNull java.util.Map<java.lang.String,java.lang.Object> context, @Nullable UserLocation userLocation, @Nullable NextUserActionState nextActionState)
The class Dialog state.
class Dialog@NotNull public java.lang.String toString()
The class Dialog state.
class Dialogpublic int hashCode()
The class Dialog state.
class Dialogpublic boolean equals(@Nullable
java.lang.Object p)
The class Dialog state.
class Dialog