This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/master by this push:
     new 94d8fea  Javadoc improvements.
94d8fea is described below

commit 94d8fea9dd26599aa4c02cba2644843d92a05116
Author: Aaron Radzinski <[email protected]>
AuthorDate: Wed Sep 23 10:38:25 2020 -0700

    Javadoc improvements.
---
 .../main/scala/org/apache/nlpcraft/model/NCContext.java   |  5 +++--
 .../scala/org/apache/nlpcraft/model/NCConversation.java   | 15 ++++++++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCContext.java 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCContext.java
index 98aec95..385c834 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCContext.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCContext.java
@@ -45,7 +45,8 @@ public interface NCContext extends Serializable {
 
     /**
      * Gets globally unique ID of the current request. Server request is 
defined as a processing of
-     * a one user input sentence.
+     * a one user input sentence. Note that the model can be accessed (i.e. 
intents can be matched) multiple times
+     * during the processing of a single request, and therefore multiple 
contexts may return the same server request ID.
      *
      * @return Server request ID.
      */
@@ -66,7 +67,7 @@ public interface NCContext extends Serializable {
     NCRequest getRequest();
 
     /**
-     * Gets current conversation.
+     * Gets current conversation for the query's user and data model.
      *
      * @return Current conversation.
      */
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCConversation.java 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCConversation.java
index b990851..88af51f 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCConversation.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCConversation.java
@@ -22,13 +22,18 @@ import java.util.Map;
 import java.util.function.Predicate;
 
 /**
- * Conversation container.
+ * Conversation container for specific user and data model.
  * <p>
  * Conversation management is based on idea of a short-term-memory (STM). STM 
can be viewed as a condensed
  * short-term history of the input for a given user and data model. Every 
submitted user request that wasn't
  * rejected is added to the conversation STM as a list of {@link NCToken 
tokens}. Existing STM tokens belonging to
  * the same {@link NCElement#getGroups() group} will be overridden by the more 
recent tokens from the same group.
- * Note also that tokens in STM automatically expire (i.e. context is 
"forgotten") after a certain period of time.
+ * Note also that tokens in STM automatically expire (i.e. context is 
"forgotten") after a certain period of time and/or
+ * based on the depth of the conversation since the last mention.
+ * <p>
+ * You can also maintain user state-machine between requests using method 
{@link #getUserData()}. This
+ * method returns mutable thread-safe container that can hold any arbitrary 
user data while supporting the same
+ * expiration logic as the rest of the conversation elements (i.e. tokens and 
previously matched intent IDs).
  *
  * @see NCContext#getConversation()
  * @see NCModelView#getConversationDepth()
@@ -86,14 +91,14 @@ public interface NCConversation {
     void clearDialog(Predicate<String/* Intent ID. */> filter);
 
     /**
-     * Gets modifiable user data container that can be to store user data in 
the conversation.
-     * Note that this data will expire the same as other elements in the 
conversation (i.e. tokens and
+     * Gets modifiable user data container that can be used to store user data 
in the conversation.
+     * Note that this data will expire the same way as other elements in the 
conversation (i.e. tokens and
      * previously matched intents).
      * <p>
      * Note that you should obtain the user data container on every intent 
callback invocation to make
      * sure that expiration policy takes an effect. Do not cache the returned 
object elsewhere.
      *
-     * @return Mutable user data container. The returned map is safe for 
concurrent modifications.
+     * @return Mutable and thread-safe user data container.
      */
     Map<String, Object> getUserData();
 }

Reply via email to