Can't Get my Custom Action to Work

Hey,

we are almost there: you need to add:

$params = {
"text": "I want to book a hotel room!"
}

then it is going to work.

Hmm, yes we messed up on our powershell commands hereā€¦but I think I got it:

this works:

$params = @{ā€œtextā€=ā€œI want to book a hotel room!ā€}

Invoke-WebRequest -Uri http://localhost:5005/model/parse -Method POST -Body ($params|ConvertTo-Json) -ContentType ā€œapplication/jsonā€

post_response.txt (1.3 KB)

Really appreciate your patience on this Julian, I am a total noob.

1 Like

No worries - I will figure that one out with you :smile:

Okay, intent is properly trained, action is executed.

Then please change:

action_names:
- utter_greet
- utter_goodbye
- utter_searching
- action_get_hotel_link

actions:
- utter_greet
- utter_goodbye
- utter_searching
- actions.BookHotel

to

actions:
- utter_greet
- utter_goodbye
- utter_searching
- action_get_hotel_link

And please use my uploaded action.py: actions_x.py (524 Bytes)

Dont forget to rename it. With all those changes, try it again please!

Ok did what you asked.

Now when I run rasa actions in one shell and rasa x in the other, I still get the same error message:

But I guess the difference now is that in my actions shell I am not getting weird warnings or errors like before and it is saying the function for the get hotel link is registered.

nlu.md (549 Bytes) domain.yml (301 Bytes) stories.md (153 Bytes)

Looks better now. Please run the action server with -vv as flags and post the output.

Is the action server defined in endpoints.yml?

Ok Julian.

It seems that there is no real change:

Yes in the endpoints.yml file I have added this line: url: http://localhost:5055/webhook

Okayā€¦ I like resistance. Please zip everything in one file and Upload it. Tomorrow morning I am going to fix this thingy. Ill keep you updated.

Ok, download it from here Julian. And thank you!

Okay @seansta,

see my modified files, overwrite yours with them, train again and then it should work.

stories.md (262 Bytes) endpoints.yml (1.3 KB) domain.yml (364 Bytes)

Basically your forgot to add the word ā€œaction_endpointā€ before inserting the url in your endpoints.yml.

Brilliant stuff Julian, it works! Thank you so much for your help :slight_smile:

Ha - finally. Glad I could help! :slight_smile: Come back to me at any time.

Hey, i have seen the solution but i am getting the same error even though i added endpoints. Could you please help me out with it, I have uploaded my files below.stories.md (1.3 KB) domain.yml (1.5 KB) actions.py (384 Bytes) endpoints.yml (58 Bytes)

I am running the actions server , I donā€™t understand the problem , could I please get some help on this @JulianGerhard error:

I also canā€™t get my custom action to workā€¦ Iā€™m running Rasa X on a server, but getting the error:

rasa-production_1 | 2020-01-17 13:58:57 ERROR rasa.core.actions.action - Failed to run custom action 'start_trea tment_form'. Couldn't connect to the server at 'http://action_server:5055/webhook'. Is the server running?

Anybody knows what can it be? @JulianGerhard could you please help me out? Maybe I need to run the action server, but I donā€™t know how to do it from a serverā€¦

Hi @tiziano,

can you please check your domain.yml for the string ā€œstart_trea tment_formā€ ? I assume you simply miss-spelled it, instead of using ā€œstart_treatment_formā€ ?

Kind regards
Julian

Brother could you help meā€¦

sample6.rar (312.2 KB) could you look this its work or not

  • When I run rasa sample code (rasa run actions & rasa shell) that action.py part does not work (custom action not work). So, could you give any solution to fix the problem

Failed to run custom action ā€˜find_facility_typesā€™

Added the custom action into the domain. But, the actual problem is when I execute the ā€œrasa run actionsā€ command that executing but, that not completed. I attached the execution time

(snake-rasa) C:\Users\Pavucs\Desktop\knowledgebasebot>rasa run actions 2020-01-23 08:39:45.626889: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll

2020-01-23 08:39:47 INFO rasa_sdk.endpoint - Starting action endpoint serverā€¦ 2020-01-23 08:39:47 INFO rasa_sdk.executor - Registered function for ā€˜action_query_knowledge_baseā€™.

finally, I got this result (uncompleted)

os:windows,
Rasa 1.6.1,
Rasa_sdk 1.6.1,
Python 3.6.10,
en-core-web-md 2.2.5,
en-core-web-sm 2.2.5,
sanic 19.9.0,

Hi @pavucsan,

your data currently looks fine to me however your postings donā€™t seem to be up to date - donā€™t they?

Did you start your bot properly? In your project folder try:

rasa run actions &&
rasa shell --debug

And then follow your story path to the actual execution of your action. Please post the results here!

Kind regards
Julian

Thanks to reply me @JulianGerhard

If I execute any project actions that doesnā€™t completeā€¦ thatā€™s my problem and last 2 weeks im trying to solve thatā€¦ Everytime I got this result onlyā€¦ When execution time I could not terminate the terminal alsoā€¦ Without actions, utter actions are working (and also bot working without custom actions) problem is, RASA run actions command not completedā€¦

Hi there! I was having same issue. I donā€™t know if itā€™s because of the PowerShell that Iā€™m using but the way I solved it is that instead of using rasa run actions && rasa shell. I ran rasa run actions in one window, opened a new window and ran rasa shell.