dariowho/intents

Introduce Session Parameters, to store structured data in session

dariowho opened this issue · 0 comments

AS A chatbot developer
I WANT TO store structured information in the conversation session
SO THAT I don't have to setup a separate persisted storage for that

Details

Intent parameters are currently limited to entities that are tagged in User messages. However, it is often useful to store structured information in the conversation session (a location, a user profile, an item metadata, ...), to be used within the conversation scope. This information cannot be tagged in user utterances; instead, it can be provided programmatically by triggers ad fulfillment results.

We want to distinguish NLU parameters and Session parameters, the first being message entities, the latter injected in session by triggers and fulfillment procedures.

To Do

Model

  • Split IntentParameterMetadata into NLU parameters and Session parameters
  • Update Intent.parameter_schema to allow for Session Parameters
  • Raise exception if Session parameter is tagged in example utterances
  • Raise exception if example utterances are defined and there is at least one required Session parameter (intent cannot be predicted)

Dialogflow

  • Export Session parameters as @sys.any intent params
  • predict/fulfill: de-serialize stored parameters (string, dataclass or JSON)
  • fulfillment result/trigger: serialize stored parameters (string, dataclass or JSON)

Alexa

  • Skip Session parameters in export

Snips

  • Skip Session parameters in export
  • Add test for triggered intent w/ Session parameters