How to get all intents in rasa

i know how to get latest intent message in my action using tracker.latest_message

but how to get last to last intent name in action?

or how to get all intents at any point of conversation?

The intent name is available inside tracker.latest_message e.g.

 "latest_message": {
    "intent": {
      "name": "greet",
      "confidence": 0.9933760762
    },
    "entities": [],
    "intent_ranking": [
      {
        "name": "greet",
        "confidence": 0.9933760762
      },
      {
        "name": "affirm",
        "confidence": 0.0030056762
      },
      {
        "name": "inform",
        "confidence": 0.0014397241
      },
      {
        "name": "bot_challenge",
        "confidence": 0.0007894791
      },
      {
        "name": "thankyou",
        "confidence": 0.0005586264
      },
      {
        "name": "deny",
        "confidence": 0.0003835451
      },
      {
        "name": "request_restaurant",
        "confidence": 0.0003376529
      },
      {
        "name": "stop",
        "confidence": 0.0000681097
      },
      {
        "name": "chitchat",
        "confidence": 0.0000410171
      }
    ],
    "text": "hi"
  },

do you mean all intents that have been seen so far in the tracker, or all available intents?

intents so far in the tracker i am looking for.

In that case you can look at the tracker’s user events e.g.

  "events": [
{
  "event": "action",
  "timestamp": 1580320782.7262749672,
  "name": "action_session_start",
  "policy": null,
  "confidence": null
}
.
.
.
{
  "event": "user",
  "timestamp": 1580320782.759968996,
  "text": "hi",
  "parse_data": {
    "intent": {
      "name": "greet",
      "confidence": 0.9933760762
    },
    "entities": [],
    "intent_ranking": [
     .
     .
     .
    ],
    "text": "hi"
  },
  "input_channel": "cmdline",
  "message_id": "da81892c53db4104b13b3c3a29f6e9a5",
  "metadata": {}
},
.
.
.
{
  "event": "user",
  "timestamp": 1580320791.4309067726,
  "text": "no",
  "parse_data": {
    "intent": {
      "name": deny,
      "confidence": 0.993
    },
    "entities": [],
    "text": "no"
  },
  "input_channel": "cmdline",
  "message_id": "369ae7f76a9d462a8edeb20cc5807cc2",
  "metadata": {}
}
]