Skip to content

Simplify effect configuration #16

@beckydvn

Description

@beckydvn

Right now, the default action configuration is a bit cluttered. Take this action from bank_bot:

  offer-pay:
    type: dialogue
    message_variants:
      - Would you like to pay off your outstanding bills today?
      - You have a few outstanding bills. Would you like to pay them off now?
    condition:
      tried-pay-bills:
        value: false
      task:
        known: false
    effect:
      start-task:
        oneof:
          outcomes:
            want-pay:
              updates:
                task:
                  known: true
                  value: pay bills
              intent: confirm
            dont-want:
              updates:
                tried-pay-bills:
                  value: true
              intent: deny
              response_variants:
                - Ok! I won't pay off your outstanding bills today.

Mainly the effect configuration could be simplified by removing the "oneof" and "outcomes" labels, which are the same every time:

  offer-pay:
    type: dialogue
    message_variants:
      - Would you like to pay off your outstanding bills today?
      - You have a few outstanding bills. Would you like to pay them off now?
    condition:
      tried-pay-bills:
        value: false
      task:
        known: false
    effect:
      start-task:
        want-pay:
          updates:
            task:
              known: true
              value: pay bills
          intent: confirm
        dont-want:
          updates:
            tried-pay-bills:
              value: true
          intent: deny
          response_variants:
            - Ok! I won't pay off your outstanding bills today.

This combined with #15 could make an even simpler configuration:

  offer-pay:
    type: dialogue
    message_variants:
      - Would you like to pay off your outstanding bills today?
      - You have a few outstanding bills. Would you like to pay them off now?
    condition:
      tried-pay-bills:
        value: false
      task:
        known: false
    effect:
      start-task:
        want-pay:
          updates:
            task:
              value: pay bills
          intent: confirm
        dont-want:
          updates:
            tried-pay-bills:
              value: true
          intent: deny
          response_variants:
            - Ok! I won't pay off your outstanding bills today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions