Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify effect configuration #16

Open
beckydvn opened this issue Aug 30, 2023 · 0 comments
Open

Simplify effect configuration #16

beckydvn opened this issue Aug 30, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@beckydvn
Copy link
Member

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.
@beckydvn beckydvn added enhancement New feature or request good first issue Good for newcomers labels Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant