mindmeld.app module¶
This module contains the app component.
-
class
mindmeld.app.
Application
(import_name, request_class=None, responder_class=None, text_preparation_pipeline=None, async_mode=False)[source]¶ Bases:
object
The conversational application.
-
import_name
¶ str -- The name of the application package.
-
app_path
¶ str -- The application path.
-
app_manager
¶ ApplicationManager -- The application manager.
-
request_class
¶ Request -- Any class that inherits from Request.
-
responder_class
¶ DialogueResponder -- Any class that inherits from the DialogueResponder.
-
text_preparation_pipeline
¶ TextPreparationPipeline -- The application text preparation pipeline, if any.
-
async_mode
¶ bool --
True
if the application is async,False
otherwise.
-
add_dialogue_rule
(name, handler, **kwargs)[source]¶ Adds a dialogue rule for the dialogue manager.
Parameters:
-
add_middleware
(middleware)[source]¶ Adds middleware for the dialogue manager
Parameters: middleware (callable) -- A dialogue manager middleware function
-
custom_action
(action=None, actions=None, async_mode=False, merge=True, config=None, **kwargs)[source]¶ Adds a custom action sequence handler for the dialogue manager.
- Whenever the user hits this state, we invoke the sequence of custom action(s) and returns
- the appropriate responder.
Parameters: - action (str) -- The name of a custom action.
- actions (list) -- A list of names of custom actions.
- async_mode (bool) -- Whether we should invoke this custom action asynchronously.
- merge (bool) -- Whether we should merge the Responder with fields from the response, otherwise we will overwrite the fields (frame, directives) accordingly.
- config (dict) -- The custom action config, if different from the application's.
-
lazy_init
(nlp=None)[source]¶ Initialize the application manager, spin up the server and compile the dialogue rules.
-
question_answerer
¶ The application's Question Answerer, which is initialized as part of the application manager.
-