buerokratt / Training-Module

MIT License
2 stars 16 forks source link

REST service to create a new Rasa story #110

Open turnerrainer opened 1 year ago

turnerrainer commented 1 year ago

AS AN Architect I WANT to have a REST service to create new Rasa stories SO THAT there wouldn't be duplicate services for it

Acceptance Criteria

Temporary list of endpoints - https://github.com/buerokratt/Buerokratt-onboarding/issues/8 Proto to add new Rasa stories

Examples

Input stories.yml before adding a new story

version: "3.0"
stories:
- story: andmekaitse_küsimused
  steps:
  - intent: andmekaitse_küsimused
  - action: utter_andmekaitse_küsimused

- story: test
  steps:
  - intent: test
  - action: utter_test
  - checkpoint: check_stuff

Request to add a story named "tervitus" with intents "greeing_ee" and "greeing_en" and action "utter_laters", the resulting stories.yml would look like

version: "3.0"
stories:
- story: andmekaitse_küsimused
  steps:
  - intent: andmekaitse_küsimused
  - action: utter_andmekaitse_küsimused

- story: test
  steps:
  - intent: test
  - action: utter_test
  - checkpoint: check_stuff

- story: tervitus
  steps:
  - intent: greeing_ee
  - intent: greeing_en
  - action: utter_laters
RaulAltmae commented 1 year ago

sample input for /rasa/stories/add

{
  "story": "tervitamine",
  "steps": [
    {
      "intent": "greeing_ee"
    },
    {
      "intent": "greeing_en"
    },
    {
      "action": "utter_laters"
    }
  ]
}
turnerrainer commented 1 year ago

@RaulAltmae please link this issue with an appropriate pull request.

RaulAltmae commented 1 year ago

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

ffrose commented 7 months ago

BUG - When creating a new Rasa story. Unable to save, after clicking "Salvesta/Save" it gives error code 409.

Image

It is possible to create a new story, when trying to "Change/Muuda" the title and then saving, it creates the story.

Image

ValterAro commented 5 months ago

Short summary: When editing the title and deleting letters one by one then when the last letter is deleted the whole selection is reset Expected result: you just enter the new title Real result: The title selection is reset How to reproduce: login and go to https://admin.dev.buerokratt.ee/training/training/stories . then try to add a story and then try to edit the title. Pic:

Image

ffrose commented 5 months ago

BUG - Occasionally i am able to create new Rasa stories, yet the second time it is not possible.

Image

1AhmedYasser commented 5 months ago

@KasparMinn please link PR

KasparMinn commented 5 months ago

PR Link: https://github.com/buerokratt/Training-Module/pull/365

This PR fixes the story title change input and save bug as well as adds a loading box display component which would appear to the user in the case of triggering any query that changes data. The loading box is ensured to disappear once the query and new data is properly validated.

Kristjan259 commented 5 months ago

Short summary: When you add three slots to the condition and then delete the middle one, then the 2 slots down the middle merge. Expected result: The middle one should just be deleted Real result: You have like 2,5 slots How to reproduce: go to stories, add 3 slots, then delete the mid one.

Pics:

Image

Image

KasparMinn commented 5 months ago

PR: https://github.com/buerokratt/Training-Module/pull/396

KasparMinn commented 5 months ago

After the GUI fix, task still needs a bit of work to adjust some Story-Rule YML writing logic, new PR soon.

KasparMinn commented 4 months ago

Important notice: For stories and rules generation, there is currently in use an alternate datamapper script called (DSL/Datamapper/js/convert/jsonToYamlStories) as the Stories & Rules YAML files are both holding a more unique structure that consists of several JSON elements. Those elements get mixed up during the object transfer in Ruuter and the file is generated in the wrong way, therefore a more manual solution was temporarily needed to make everything work.

KasparMinn commented 4 months ago

PR to add some elements to YAML generation: https://github.com/buerokratt/Training-Module/pull/398

ValterAro commented 4 months ago

Short summary: same bug as in the rules (https://github.com/buerokratt/Training-Module/issues/111#issuecomment-1966428009). Basically the flow of the story is different from the one that was created. Conditions and slots are gone and others are shown as response. Pic:

Image

ValterAro commented 4 months ago

Short summary: when trying to add a new rule or story with a name, then you need to write the name of the story or rule again when in the flow view. Basically you need to write the title twice. Pic:

Image

Image

KasparMinn commented 4 months ago

PR: https://github.com/buerokratt/Training-Module/pull/405

ValterAro commented 4 months ago

Short summary: Can't add a story as I get an error. No matter which elements I try I seem to get an error. How to reproduce: login and go to https://admin.dev.buerokratt.ee/training/training/stories and try to add a new story. Additional note: The previous bug, where you need to enter the name two times is still there and is currently not logical, that the add button does not take the name from the field. Pic:

Image

turnerrainer commented 4 months ago

According to @KasparMinn this task was previously moved to "ATR" due to deployment errors. No development done or needed.

Kristjan259 commented 4 months ago

Gives an 500 error code when I try to make a new story. Image

error message: { "error": "ScriptingException: Error executing script: JSON.parse(storiesData).response.body.stories" }

Kristjan259 commented 4 months ago

Still the same issue as stated in my earlier comment.

KlviG commented 3 months ago

Error executing DSL: rasa/stories/add Caused by: ee.buerokratt.ruuter.service.exception.StepExecutionException: Error executing: mergeStories Caused by: ee.buerokratt.ruuter.helper.exception.ScriptEvaluationException: Error executing script: JSON.parse(storiesData).response.body.stories