S5_AR01/rasa/actions/actions.py
2024-10-08 09:33:51 +02:00

26 lines
635 B
Python

# actions.py
from rasa_sdk import Action
from rasa_sdk.events import SlotSet
import smtplib
import requests
class ActionSendEmail(Action):
def name(self):
return "action_send_email"
def run(self, dispatcher, tracker, domain):
# Simulation in write log in file
with open('../log.txt', 'w') as f:
f.write("Email sent\n")
class ActionGetWeather(Action):
def name(self):
return "action_get_weather"
def run(self, dispatcher, tracker, domain):
# Simulation in write log in file
with open('../log.txt', 'w') as f:
f.write("Wwaether API called\n")