need help how could i write this code : http://data.fixer.io/api/convert ? access_key = API_KEY & from = GBP & to = JPY & amount = 25 on action.py :
This files contains your custom actions which can be used to run
custom Python code.
See this guide on how to implement these action:
Actions
from typing import Any, Text, Dict, List from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher #from rasa_sdk.events import Slotset
class ActionHelloWorld(Action):
def name(self) -> Text:
return "action_hello_world"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
montant = tracker.get_slot("montant")
devise = tracker.get_slot("devise")
result_amount = 3000
###########################################
############################################
dispatcher.utter_message("le montant {} en {} sera {} en DT".format(montant,devise, result_amount))
#dispatcher.utter_message("ceci est my action 3")
#return[Slotset("devise",devise)]
return[]