Please refer to the post below for details on retrieving chatbot history using the Directline API and displaying it with adaptive cards at the end of the conversation:
Chatbot History with Directline API
If my answer helped you, could you mark it as a verified solution? This really helps other members with the same problem find the solution faster.