Extracting sender_email from google chat

I am trying to extract the sender_email using the hangouts.py(rasa/rasa/core/channels/hangouts.py at main · RasaHQ/rasa · GitHub) extract_sender function but everytime I try to run it, it has no req parameter. How do i define the “req”.

Here is my code:

def _extract_sender_email(req: Request) -> Text:

        if req.json["type"] == "MESSAGE":
            return req.json["message"]["sender"]["email"]

        return req.json["user"]["email"]


class ActionAuth(Action):
    def name(self) -> Text:
        return "action_test"

    def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[Dict[Text, Any]]:

        email = _extract_sender_email(req)
        print(email)

@kuldeep I saw that you resolved ur issue. Do you know the answer?

Hi @CarlosMagalhaes2,

How are you passing req in the first place to _extract_sender_email method inside run? Are you getting it from somewhere?

Hello @anoopshrma ,

I am not getting it from anywhere in the code, i dont know what the req is supposed to be. Are you understanding my problem? I dont know what I should define the req variable has.

Thank you.