Endpoint in custom action

I am getting error in running custom action. i have already defined endpoint for that like in endpoint.yml:

action_endpoint: url: “http://192.158.14.201:5055

Untitled

Please help me out.

can you share what you are running in the custom action

did you add the method def name which returns the name of the action for the class

from future import absolute_import

from future import division

from future import print_function

from future import unicode_literals

from rasa_core.actions import Action

from rasa_core.events import SlotSet

class ActionOutstandingAmount(Action):

def name(self):
	return 'action_outstanding_amount'
	
def run(self, dispatcher, tracker, domain):
	dispatcher.utter_message("Got It!")
	
	return[]

Add a /webhook to your endpoint I noticed it now

action_endpoint: 
    url: http://192.158.14.201:5055/webhook
1 Like

still getting same error.

Strange It should not really have an error if your endpoint is correct

what is the command you have used to run the rasa server?

To run the ednpoint server:

python -m rasa_core_sdk.endpoint --actions action

To run rasa core:

python -m rasa_core.run --enable_api -d models/current/dialogue -u models/current/nlu

Add

python -m rasa_core.run --enable_api --endpoints endpoints.yml -d models/current/dialogue -u models/current/nlu

now it is saying:

Failed to run custom action ‘action_outstanding_amount’. Couldn’t connect to the server at ‘http://localhost:5055/webhook’. Is the server running? Error: HTTPConnectionPool(host=‘localhost’, port=5055): Max retries exceeded with url: /webhook (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7fa35a7d3400>: Failed to establish a new connection: [Errno 111] Connection refused’,))

2018-10-10 10:50:21 ERROR rasa_core.processor - Encountered an exception while running action ‘action_outstanding_amount’. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.

2018-10-10 10:50:21 ERROR rasa_core.processor - Failed to execute custom action.

Why is it searching for internet??

Solved the issue. thanks

can you please tell me how to configure endpoints.yml

how you solve that issue?. thanks

For people here still asking:

What I believe happened, is that by adding: ‘–endpoints endpoints.yml’ Raghibomar specified to the server a file pointing to where his action server is. You can get a default version of the file from the rasa github repo’s.

You then have to run the action server AND the rasa server. The action server acts as a gateway from what I can tell. Allows stuff like api calls etc.

If you have cmake installed, starting an action server from your project root is just ‘make action-server’. Otherwise, its python -m rasa_core_sdk.endpoint --actions action

good luck!

Hello, I’m sturggling to make the action server work. I’m trying to run it as a service on Google App Engine but the url of the service won’t work. Could you explain how to do it? I have the rasa server good and running, it’s just that can’t reach the action server to send a response back.

Thanks!

hello, i have some problem with custom action. i’ll show my data from my API or my URL but i can’t, how i can show data from my url?