Conversation History
Conversation History
The get_conversation() function allows you to retrieve the conversation history for a specific conversation in Blipper. This function takes the conversation ID as a parameter and returns the conversation history, including messages exchanged between the user and the agent.
1 2 3 4 5 | |
Note
If you obtain an empty list, it means that no messages have been added to the conversation yet. You can learn how to add messages in the next section. Please see the Add message to a conversation section.
The messages variable will contain a list where each item represents a message exchanged between the user and the agent. Each message object contains the following attributes:
- role: Specifies the role of the sender (e.g., "user" or "agent").
- content: Contains the content of the message exchanged.
Example response format related to a Food Agent:
[
{"role": "user", "content": "I'd like to order a pizza."},
{"role": "agent", "content": "Sure! What toppings would you like on your pizza?"},
{"role": "user", "content": "I'd like pepperoni and mushrooms, please."},
{"role": "agent", "content": "Great choice! Your order has been placed."},
]