Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 119 additions & 2 deletions actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# This is a simple example for a custom action which utters "Hello World!"

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker
from rasa_sdk.events import SlotSet, EventType
from rasa_sdk.executor import CollectingDispatcher, Action
Expand Down Expand Up @@ -158,4 +157,122 @@ def run(self, dispatcher: CollectingDispatcher,
dispatcher.utter_message(answer)
DataUpdate(user_input,answer)
print(user_input)
return[]
return[]

class ActionOpenProjectLinkssbgh(Action):
def name(self) -> Text:
return "action_open_project_link_ssb_github"

def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# Replace the `project_link` with the actual link to your self-balancing bot project
project_link = "https://github.com/roboclub-mnnit/SelfBalancingBot-2022-23-Project"
webbrowser.open(project_link)
dispatcher.utter_message(text=f"You can find the github repository at this link: {project_link}")
return []

class ActionOpenVideoLink1(Action):
def name(self) -> Text:
return "action_open_ssb_video_link"

def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# Extract the video link from the tracker
video_link = "https://youtu.be/lqwXdpySzbQ"

if video_link:
# Open the video link in a web browser
webbrowser.open(video_link)

# Send a message to the user acknowledging the action
dispatcher.utter_message(text=f"Sure! I've opened the video link for you. You can watch it [here]({video_link}).")
else:
# If video link is not available, send a message to the user
dispatcher.utter_message(text="Sorry, I couldn't find the video link.")

return []

class ActionOpenVideoLink2(Action):
def name(self) -> Text:
return "action_open_mcg_video_link"

def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# Extract the video link from the tracker
video_link = "https://youtu.be/1MGkDt1iHKA"

if video_link:
# Open the video link in a web browser
webbrowser.open(video_link)

# Send a message to the user acknowledging the action
dispatcher.utter_message(text=f"Sure! I've opened the video link for you. You can watch it [here]({video_link}).")
else:
# If video link is not available, send a message to the user
dispatcher.utter_message(text="Sorry, I couldn't find the video link.")

return []

class ActionOpenVideoLink3(Action):
def name(self) -> Text:
return "action_open_rcs_video_link"

def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# Extract the video link from the tracker
video_link = "https://youtu.be/1MGkDt1iHKA"

if video_link:
# Open the video link in a web browser
webbrowser.open(video_link)

# Send a message to the user acknowledging the action
dispatcher.utter_message(text=f"Sure! I've opened the video link for you. You can watch it [here]({video_link}).")
else:
# If video link is not available, send a message to the user
dispatcher.utter_message(text="Sorry, I couldn't find the video link.")

return []

class ActionOpenVideoLink4(Action):
def name(self) -> Text:
return "action_open_ats_video_link"

def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# Extract the video link from the tracker
video_link = "https://youtu.be/1MGkDt1iHKA"

if video_link:
# Open the video link in a web browser
webbrowser.open(video_link)

# Send a message to the user acknowledging the action
dispatcher.utter_message(text=f"Sure! I've opened the video link for you. You can watch it [here]({video_link}).")
else:
# If video link is not available, send a message to the user
dispatcher.utter_message(text="Sorry, I couldn't find the video link.")

return []

class ActionOpenVideoLink5(Action):
def name(self) -> Text:
return "action_open_vtt_video_link"

def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# Extract the video link from the tracker
video_link = "https://youtu.be/1MGkDt1iHKA"

if video_link:
# Open the video link in a web browser
webbrowser.open(video_link)

# Send a message to the user acknowledging the action
dispatcher.utter_message(text=f"Sure! I've opened the video link for you. You can watch it [here]({video_link}).")
else:
# If video link is not available, send a message to the user
dispatcher.utter_message(text="Sorry, I couldn't find the video link.")

return []