Search code examples
c#botframeworkazure-cosmosdb

Bot Framework v4 c# - How to save entire chat conversation between user and chatbot


I want to save entire conversation happened between user and chatbot in cosmos db.

I tried this link but it only save the user data

and also tried using ITranscriptLogger but this is creating new item for each activity between user and bot

enter image description here

I want something like there should be one item created in cosmos db for specific user which has full conversation history between bot and user

Could any one let me know how can i do that

Thanks


Solution

  • As @Mark mentioned it is not recommended to create just a single document to hold a conversation history.

    GetTranscriptActivitiesAsync - This method pulls all the conversations. This brings all the activity that that is part of. enter image description here

    In the above screenshot, you can see all the activities pertaining to the conversation.

    Just a thought - You could iterate to each of them & you could combine them and save it in a single file.

    Came across this sample - here the entire conversation history sent back to the chat.