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

Feat/error recovery dsl #155

Merged
merged 12 commits into from
Jul 24, 2022
Merged

Feat/error recovery dsl #155

merged 12 commits into from
Jul 24, 2022

Conversation

ltbringer
Copy link
Contributor

In this PR we are adding the first version of a high-level language that enables state changes on certain events defined as rules.
The API of the current state is rigid, to enable the usage and identify areas that require far more flexibility.

Including some example rules:

rules:
  -
    doc: "Remove entities that belong to `now` if other time entities are present."
    remove: entities
    where:
      - entity.grain: second
      - entity.entity_type:
          in: ["time", "datetime"]
      - entity.type: "value"
  -
    doc: "Remove intent named placeholder."
    remove: intents
    where:
      - intent.name:
          in: [placeholder]
      - current_state:
          in: ["non_placeholder", "unsafe"]
  -
    doc: "Rename the intent with the highest confidence to _confirm_ if a certain state is expected."
    find: intents
    where:
      - intent.name:
          in: [placeholder]
      - current_state:
          in: ["non_placeholder", "unsafe"]
    update:
        intent.name: _confirm_
  -
    doc: "Update DateTime entities such that day is set to week's last date."
    find: entities
    where:
      - entity.grain: week
      - entity.entity_type:
          in: ["date", "time", "datetime"]
      - predicted_intent: "future_date" 
    update:
      entity.day: :last_day_of_week

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2022

Codecov Report

Merging #155 (1a6c4f7) into master (55b84ac) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            master      #155    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           50        49     -1     
  Lines         2258      2362   +104     
==========================================
+ Hits          2258      2362   +104     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dialogy/plugins/__init__.py 100.00% <ø> (ø)
dialogy/types/__init__.py 100.00% <ø> (ø)
dialogy/base/input/__init__.py 100.00% <100.00%> (ø)
...logy/plugins/text/error_recovery/error_recovery.py 100.00% <100.00%> (ø)
dialogy/types/entity/time/__init__.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

@ltbringer ltbringer merged commit de5e298 into master Jul 24, 2022
@ltbringer ltbringer deleted the feat/error_recovery_dsl branch July 24, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants