Hello. First of all, I use RASA for the first time. So I study how to deal with RASA. But, I don’t know why…?
This is error message.(down)
rasa_sdk.executor - Failed to register package ‘actions’. ---------------------
Do you know why…?
Hello. First of all, I use RASA for the first time. So I study how to deal with RASA. But, I don’t know why…?
rasa_sdk.executor - Failed to register package ‘actions’. ---------------------
Do you know why…?
@Chan can you please share rasa version --version.
@Chan check the spelling of rasa, you mentioned rask_sdk
use this:
from rasa_sdk.forms import FormAction
Human error I hope this will solve you issue.
Thank you for responsing.
My Rasa’s version :
And… Can I ask something for Rasa with udemy…? My Friend recommend Udemy’s lecture.
But… I don’t know Why next step is failed…
Anyway. Thank you for responsing !
@Chan your current error is sorted?
@Chan go ahead what you want to know regarding Udemy course of rasa?
Oh MY GOD!!! Thank you so much. Around me, My friend don’t know RASA. In addition, I’m a student and I look at your profile. WOW… I’m so envy your experience.
This is Udemy’s lecture (free) : https://www.udemy.com/course/rasa-for-beginners/
Error is occured at 30:33(timeline), section3 - 5.Form
In video, Teacher’s RASA is reacted (she’s rasa is updated but i’m not)
▽ Teacher’s view
But… My Rasa is not updated ▽ My monitor
and then I action [ rasa run actions ] But… It’s now updated.
Oh… Sorry. The spelling is wrong spelling.
It’s NOT updated…
Sorry.
Yes…
Now I restart my laptop and react to run Rasa
I’m so sad… And Can you advise how to learn about Rasa and so forth…
I’M SO Thank you.
And I correct rask_sdk → rasa_sdk
Thank you. haha.
I hope it’s same as the udemy teacher’s view umm…
So, It’s not to be wrong my Rasa or Bot?
You are my Rasa’s Mentor (haha). And I’m a Korean so I can not speak fluent English well.
Yes, It’s running now.
nik202… Can you look at my code.?
I correct your advice(#1)… Umm…
Under codes, Just follow the udemy’s
<actions.py> from typing import Any, Text, Dict, List, Union
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
#from rasa_sdk.forms import FormAction
#nik202’s help under code
from rasa_sdk.forms import FormAction
from requests import exceptions
from requests.api import request
from requests.models import HTTPError, Response
from dotenv import load_dotenv
import requests
import json
import os
load_dotenv()
airtable_api_key=os.getenv(“AIRTABLE_APY_KEY”)
base_id=getenv(“BASE_ID”)
table_name=os.getenv(“TABLE_NAME”)
def creat_health_log(confirm_exercise, exercise, sleep, diet, stress, goal):
request_url="https://api.airtalbe.com/v0/{base_id}/{table_name}"
headers = {
"Content-Type": "application/json",
"Accept" : "application/json",
"Authorization" : {"Bearer {airtable_api_key}"}
}
data = {
"fields" : {
"Exercised?" : confirm_exercise,
"Type of exercise" : exercise,
"Amount of sleep" : sleep,
"Stress" : stress,
"Diet" : diet,
"Goal" : goal
}
}
try:
response = requests.post(
request_url, headers=headers, data = json.dumps(data)
)
response.raise_for_status()
except requests.exceptions.HTTPError as err:
raise SystemError(err)
return response
print(response.status_code)
class HealthForm(FormAction):
def name(self):
return "health_form"
@staticmethod
def required_slots(tracker):
if tracker.get_slot("confirm_exercise") == True:
return ["confirm_exericse", "ecercise", "sleep", "diet", "stress", "goal"]
else:
return ["confirm_exercise", "sleep", "diet", "stress", "goal"]
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
response = creat_health_log(
tracker.get_slot("confirm_exercise"),
tracker.get_slot("exercise"),
tracker.get_slot("sleep"),
tracker.get_slot("diet"),
tracker.get_slot("stress"),
tracker.get_slot("goal")
)
dispatcher.utter_message("Thanks")
return[]
def slot_mapping(self) -> Dict[Text, Union[Dict, List[Dict]]]:
return {
"confirm_exercise": [
self.from_intent(intent="affirm", value=True),
self.from_intent(intent="deny", value=True),
self.from_intent(intent="inform", value=True)
],
"sleep": [
self.from_entity(entity="sleep"),
self.from_intent(intent="deny", value="None")
],
"diet":[
self.from_text(intent = "inform"),
self.from_text(intent = "affirm"),
self.from_text(intent = "deny")
],
"goal":[
self.from_text(intent = "inform"),
]
}
@Chan Please don’t mind you code is not correct and even I am not able to understand what you trying to archive? can you tell me what you trying to archived?
lets… I’m just trying to follow udemy’s teacher. And I hope I wish it were the same udemy’s teacher. In the process, udemy’s teacher’s monitor is not same my prompt.
I hope to archive user’s input text.
First of all, I study lots of udemy’s code and lecture.
I’m so thank you and you are so kind of you because you are directly feedback to me in real time.