NCModelClient
Client API to issue requests again given model. This the primary method of interacting with NLPCraft from the user perspective.
- Value parameters:
- mdl
A data model to issue requests against.
- Source:
- NCModelClient.scala
Value members
Concrete methods
Passes given input text to the model's pipeline for processing.
Passes given input text to the model's pipeline for processing.
This method takes given text, passes it to the pipeline for parsing and enrichment, then tries to match it against declared intents. If the winning intent match is found, its callback is called and result is returned here.
- Value parameters:
- data
Optional data container that will be available to the intent matching IDL.
- txt
Text of the request.
- usrId
ID of the user to associate with this request.
- Returns:
Callback result from the winning intent match. This method never returns
null
.- Throws:
- NCException
Thrown in case of any internal errors processing the user input.
- NCRejection
An exception indicating a rejection of the user input. This exception is thrown automatically by the processing logic as well as can be thrown by the user from the intent callback.
- Source:
- NCModelClient.scala
Removes all previously matched intents from the memory associated with given user ID.
Removes all previously matched intents from the memory associated with given user ID.
- Value parameters:
- usrId
User ID for which to clear dialog history.
- Source:
- NCModelClient.scala
Removes previously matched intents satisfying given filter from the memory associated with given user ID.
Removes previously matched intents satisfying given filter from the memory associated with given user ID.
- Value parameters:
- filter
Dialog flow item filter.
- usrId
User ID for which to clear dialog history.
- Source:
- NCModelClient.scala
Removes all entities from the short-term-memory (STM) associated with given user ID.
Removes all entities from the short-term-memory (STM) associated with given user ID.
- Value parameters:
- usrId
User ID for which to clear STM.
- Source:
- NCModelClient.scala
Removes entities satisfying given filter from the short-term-memory (STM) associated with given user ID.
Removes entities satisfying given filter from the short-term-memory (STM) associated with given user ID.
- Value parameters:
- filter
Entity filter.
- usrId
User ID for which to clear STM.
- Source:
- NCModelClient.scala
Closes this client releasing its associated resources.
Closes this client releasing its associated resources.
- Definition Classes
- AutoCloseable
- Source:
- NCModelClient.scala
Passes given input text to the model's pipeline for processing.
Passes given input text to the model's pipeline for processing.
This method differs from NCModelClient.ask method in a way that instead of calling a callback of the winning intent this method returns the descriptor of that callback without actually calling it. This method is well suited for testing the model's intent matching logic without automatically executing the actual intent's callbacks.
- Value parameters:
- data
Optional data container that will be available to the intent matching IDL.
- saveHist
Whether or not to store matched intent in the dialog history.
- txt
Text of the request.
- usrId
ID of the user to associate with this request.
- Returns:
Processing result. This method never returns
null
.- Throws:
- NCException
Thrown in case of any internal errors processing the user input.
- NCRejection
An exception indicating a rejection of the user input. This exception is thrown automatically by the processing logic as well as can be thrown by the user from the intent callback.
- Source:
- NCModelClient.scala