buerokratt / Training-Module

MIT License
2 stars 20 forks source link

REST service to update the content of a specified Rasa regex example #128

Open turnerrainer opened 1 year ago

turnerrainer commented 1 year ago

AS AN Architect I WANT TO have a REST service to update an existing Rasa regex example SO THAT there wouldn't be any duplicate services for it

Acceptance Criteria

Examples

data/regex_nlu.yml

Input

version: "3.0"
nlu:
- regex: asukoht
  examples: |
    - abja[- ]paluoja
    - antsla
    - elva
    - haapsalu

- regex: nimed
  examples: |
    - büro
    - kratt
    - bürokratt

Output after making a request to update "antsla" to "[Aa]ntsla" within entity "asukoht"

version: "3.0"
nlu:
- regex: asukoht
  examples: |
    - abja[- ]paluoja
    - [Aa]ntsla
    - elva
    - haapsalu

- regex: nimed
  examples: |
    - büro
    - kratt
    - bürokratt
janyprus commented 1 year ago

sample input for /rasa/regex/update

{
    "regex_name": "asukoht",
    "input": {
        "regex": "asukoht",
        "examples": [
            "abja[- ]paluoja",
            "[Aa]ntsla",
            "elva",
            "haapsalu"
        ]
    }
}
RaulAltmae commented 1 year ago

Pull request https://github.com/buerokratt/Training-Module/pull/190

turnerrainer commented 11 months ago

As per @ExiRain suggestion, the current solution should be re-written to only overwrite the values that are currently selected to be changed, instead of overwriting the whole content of the file.

turnerrainer commented 11 months ago

Working, but could be optimized. In Acceptance Testing but should be refactored later.

ExiRain commented 11 months ago

Pull requests: 264 258 Currently working, but working on optimisation (currently it requires entire array to replace existing, which is not best way, new solution would require only name of regex and old value + newvalue of example, which in total 3 values to update examples)

ffrose commented 9 months ago

BUG - Unable to add regexes. image

Unable to add regex examples. image

ffrose commented 8 months ago

Blocked because of #325. When adding new regex examples is possible, then we are able to test updating.

ValterAro commented 7 months ago

Seems to work as intended!