Hi everybody.
I work on a university where each student has a unique number, called RA. I also have a form with RA, name and email fields. But I want to when the student give his RA, fill name a email via API (I already have this function working inside form’s class).
How can I put this values inside a form field?
Below, my code resumed:
class AlunoForm(FormAction):
def name(self):
return "aluno_form"
@staticmethod
def required_slots(tracker):
return ["ra", "nome", "email"]
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
return {
"ra": [
self.from_text(intent="ra"),
self.from_entity(entity="ra"),
],
}
def buscarDadosAluno(self,ra_aluno):
---API function omited---
return raf,nomef,emailf
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
data=self.buscarDadosAluno(512203)
dispatcher.utter_message("Obrigado pelas informações")
return []