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

API Domain Call Issues #4080

Closed
rgstephens opened this issue Jul 23, 2019 · 9 comments
Closed

API Domain Call Issues #4080

rgstephens opened this issue Jul 23, 2019 · 9 comments
Labels
area:rasa-x/backend 🎩 All issues focused on the Rasa X backend status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@rgstephens
Copy link
Contributor

The Rasa X domain related API calls have some issues:

  • There should be a DELETE call as there is for the Stories & NLU Training data API calls
  • The PUT appears to do nothing unless you specify the store_templates=true param. It should update the domain like the Stories & NLU calls do as it's default (without requiring a query param).
  • The PUT call with store_templates=true updated intents and actions but not templates.

There is no way to delete content from the domain via the API.

Rasa X version: 0.19.5

@rgstephens rgstephens added the type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jul 23, 2019
@msamogh
Copy link
Contributor

msamogh commented Jul 23, 2019

Thanks for raising this issue, @wochinge will get back to you about it soon.

@wochinge wochinge added the area:rasa-x/backend 🎩 All issues focused on the Rasa X backend label Jul 23, 2019
@wochinge
Copy link
Contributor

There should be a DELETE call as there is for the Stories & NLU Training data API calls

What do you need the DELETE for? We didn't have the use case yet that we have to delete a domain.

The PUT appears to do nothing unless you specify the store_templates=true param

It does so, means entities, intents and so on should be updated. Do you have an example where this wasn't the case?

The PUT call with store_templates=true updated intents and actions but not templates.

Mhm, how did your domain body look like? seems sth is wrong here.

By the way:
We are also adding new endpoints to manipulate actions in a domain in the next release 🎉

@rgstephens
Copy link
Contributor Author

As discussed in this forum thread, the use case is where we want to reset the content of an existing Rasa X instance.

If I start with a new Rasa X instance and I want to import existing NLU, Stories and domain.

For the domain, there's no POST like there is for NLU & Stories. I use the PUT method on the following domain.yml and the following domain.yml. The results are completely inconsistent but the status return is always 200. Sometimes it works and sometimes it doesn't. I confirm that my domain in the UI is empty. I've tried the PUT with store_templates=true and with no value. Mostly it is not working the more I test the API and review the domain in the UI. I've probably run 10-15 tests of the PUT this morning with different store_templates options and domain files.

intents:
  - greet
  - goodbye
  - mood_affirm
  - mood_deny
  - mood_great

actions:
- utter_greet
- utter_did_that_help
- utter_happy
- utter_goodbye

templates:
  utter_greet:
  - text: "Hey! How are you?"
  utter_did_that_help:
  - text: "Did that help you?"
  utter_happy:
  - text: "Great carry on!"
  utter_goodbye:
  - text: "Bye"

@rgstephens
Copy link
Contributor Author

I've done some more testing with templates. I'm using store_templates=true and an updated domain from the one above. I've (1) replaced utter_greet with utter_greet_greg; and (2) removed utter_goodbye and get a status 200 from the PUT.

intents:
  - greet_greg
  - goodbye
  - mood_affirm
  - mood_deny

actions:
- utter_greet_greg
- utter_did_that_help
- utter_happy

templates:
  utter_greet_greg:
  - text: "Hey! How are you Greg?"
  utter_did_that_help:
  - text: "Did that help you?"
  utter_happy:
  - text: "Great carry on!"

As you can see from this screenshot of Responses, I see the following issues:

  • Now two copies of utter_happy & utter_did_that_help
  • utter_greet should be deleted but it still exists
  • utter_goodbye should have been deleted

Screen Shot 2019-07-23 at 8 51 13 AM

I see from some comments from #3798 that templates are really moving out of the domain and should be edited separately. Maybe there should be a separate set of calls for templates from the domain calls and just completely pull templates out of domain.

@wochinge
Copy link
Contributor

I just tried the endpoint myself and it's working as expected. Do you have an idea what could be going wrong here @ricwo ?

@ricwo
Copy link
Contributor

ricwo commented Jul 25, 2019

Hi @rgstephens, I haven't been able to reproduce the issues you mentioned. Would you mind sharing exact steps to reproduce the problem? Here's what I did:

  1. PUT your first domain from API Domain Call Issues #4080 (comment) with ?store_templates=true
  2. PUT your first second from API Domain Call Issues #4080 (comment) with ?store_templates=true

Result:

  • one of each utter_happy and utter_did_that_help
  • utter_greet has been deleted
  • utter_goodbye has been deleted

@rgstephens
Copy link
Contributor Author

ok, so before I start, I'm going to remove my domain. Here's what it looks like before I start testing:

Screen Shot 2019-07-24 at 10 12 22 PM

I make the domain PUT call without the store_templates option and nothing is deleted. I make the call again with the option and everything is removed. I expected the first call to remove my intents and actions, but the UI is clear so I'll start a new test.

I put the original domain file with the store_templates option and the templates show up in the domain UI but not the intents or actions:

Screen Shot 2019-07-24 at 10 29 12 PM

I can't run step #2 without my intents & actions so I run another PUT without store_templates and I get my intents & actions.

Screen Shot 2019-07-24 at 10 43 13 PM

Now I do as you request and do the PUT with store_templates but with the 2nd version of the domain:

Screen Shot 2019-07-24 at 10 44 37 PM

Everything worked this time, but I had to run the PUT twice to get everything uploaded.

@tmbo
Copy link
Member

tmbo commented Sep 3, 2019

@ricwo can you take another look at this? feel free to close if we can not reproduce

@tmbo tmbo added the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Sep 3, 2019
@rgstephens
Copy link
Contributor Author

I think this can be closed. The remaining issues in this thread are covered in #4185.

@no-response no-response bot removed the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Sep 3, 2019
@tmbo tmbo added the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-x/backend 🎩 All issues focused on the Rasa X backend status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

5 participants