Referencing multiple entities of the same type in a response

624 views Asked by At

My user input has two different entity references of the same type and I'd like to be able to independently reference them, ideally in both condition checking and output. Is this possible?

For example a user might enter "between 1pm and 3pm" and conversation shows there's @sys-time:13:00:00 and @sys-time:15:00:00. I want to set a context variable $start and another $end. How do I individually reference the entities?

1

There are 1 answers

0
mnsuk On

Tried the obvious and it works -> @sys-time[0] and @sys-time[1]. Though @sys-time doesn't appear to reference the array rather it looks like shorthand for @sys-time[0]. So solution is

Condition #Fixture_Future AND @sys-time.length > 1

Response

 { 
    "output": {
      "text": "<fixtures></fixtures>"
    },
    “context”: {
      “start”: @sys-time[0],
      “end”: @sys-time[1]
    },
 }

and this works