Do not execute me actions.py. I need help

Hello everyone, I’m new using rasa, and I’m learning.

My problem is that I do not call the function that is in actions.py, when I try to make a sentence, the wizard gets a parameter and manipulates it, in my case going from degrees Celsius to Kelvin degrees.

I would like to know what is wrong with my code, because I have been reviewing a lot of rasa docs, but I can not find what I have done wrong, thanks and regards.

I leave the link to GitHub, so you can see the project.

https://github.com/javigala98/prueba

hey @javigala98 i think problem is in your story file celsius to kelvin train1 and 2 story and also make more training data and change config to spacy pipeline.

I do not understand what you mean with training file 1 and 2, I only have the archvio nlu, and the stories for training. And what is the problem of using tensorflow, instead of spacy?

Thanks.

@javigala98 if you have more that 1000 data then use tensorflow otherwise it’s good to use spacy, and i talk about a story.md file where you check story in the bottom line.make sure in your story file you fill slot filling properly.

When I’m executing the assistant, I pass 45 to Kelvin, the intention is correct, but not at that moment, I get caught because he does not know how to continue because he does not call me to action. I do not know if you mean that.

Ma would like to know what is what you have to put in stories.md so that I get the data of the phrase and I execute the actions, that is, I am missing ami.

Thanks for the help.

know_grades_in_kelvin{“temperature”:“192”} - action_celsius_to_kelvin apply like this, and also tun both file action file and user input file i mean command file where you enter your question.

I have tried as you said and it has not worked. How do I configure the action to obtain the data and execute it?

show me where you feel stuff.

stories.md

celsius to kelvin train1

  • know_grades_in_kelvin{“temperature”:“34”}
    • action_celsius_to_kelvin

celsius to kelvin train2

  • know_grades_in_kelvin{“temperature”:“192”}
    • action_celsius_to_kelvin

celsius to kelvin train3

  • know_grades_in_kelvin{“temperature”:"-24"}
    • action_celsius_to_kelvin


actions.py

class ActionCelsiusToKelvin(Action): “”“action_celsius_to_kelvin”"" def name(self): return “action_celsius_to_kelvin”

def run(self, dispatcher, tracker, domain): temp = tracker.get_slot(‘temperature’) suma = (int(temp) + 273) result = ‘Result: {} grades kelvin’.format(suma) dispatcher.utter_response(‘action_celsius_to_kelvin’, result)

ohh can you put slot name into nlu.md file?

like i Tell you, here in nlu.md data you put this sentence-> 56 grades celsius in kelvin. now you put like this type of -> 56 grades celsius kelvin. 56

like this then its’s got the slot value.

It has not worked, I pass the nlu to you if you want to check if there is something wrong in the code.

intent:know_grades_in_kelvin

  • Tell me, 56 grades celsius in kelvin

  • How much is -22 grades celsius in kelvin

  • 45 to kelvin

  • 102 grades to kelvin

  • -137 in kelvin

  • 56 grades celsius kelvin. 56

hyperlinks actually sets [num]_(temperature), without the low bar

Hi, your nlu can learn, so have you put enough examples for it so it can learn what you mean when you say something? otherwise if you do not have enough examples in nlu you have to use exactly what you have written in your nlu file and not something else, write at least 10 examples, same sentence but with different numbers. Example: intent:

45 to kelvin

34 to kelvin

22 to kelvin

11 to kelvin…

see if that works! for me it worked!

It has not worked for me, the problem is not the part of NLU, it is the part of the core, that I do not know that I am not doing well so that it fails me, and I do not do the actions

For the one who has the same problem as me, I have managed to solve hardcodeando the endpoint and the import of actions is wrong. In the Rasa documentation I have not found anything, it may have happened to you.

The actions.py would remain

from rasa_core_sdk import Action

Code

And the run, in my case test_core.py: agent = Agent.load (‘models / dialogue’, interpreter = interpreter, action_endpoint = EndpointConfig (url = “http://127.0.0.1:5055/webhook”))

This two things are changed and it would work.

a greeting