# Messages

In the messages tab, you can view all conversations in a table format. Every row in the table indicates an interaction, also known as a chat log. This view is useful for

* Filtering Chat Logs
* Exporting to CSV or UAT
* Viewing the Sources of the bot's responses

### Filtering Chat Logs

Filter chat logs (on the top of the page) based on several fields. Each field has a specific filter use case.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FXSOIF9sVbRgCaITQXYhT%2FGroup%20203.png?alt=media&#x26;token=14b6aa52-78b6-4f97-9d12-5c68fe484ea0" alt="" width="375"><figcaption><p>Message Tab Filter Options</p></figcaption></figure>

<table><thead><tr><th>Field</th><th>Use Case</th><th data-hidden></th></tr></thead><tbody><tr><td>ID</td><td>Finds all chat logs from a specific ID</td><td></td></tr><tr><td>User ID</td><td>Finds all chat logs from a specific user ID</td><td></td></tr><tr><td>Story ID</td><td>Find all chat logs that triggered a specific story ID </td><td></td></tr><tr><td>Recorded At</td><td>Find all chat logs before or after a specific date and time</td><td></td></tr><tr><td>Image</td><td>Find all chat logs that were triggered with an image message</td><td></td></tr><tr><td>Button Click</td><td>Find all chat logs that were triggered by a button click or postback event</td><td></td></tr><tr><td>Message Text</td><td>Find all chat logs containing a specific keyword</td><td></td></tr><tr><td>User Name</td><td>Find all chat logs from a specific user, filterable by the user's name</td><td></td></tr><tr><td>Channel</td><td>Find all chat logs from a specific channel</td><td></td></tr><tr><td>Widget ID</td><td>Find all chat logs with a specific widget ID</td><td></td></tr><tr><td>Story Name</td><td>Find all chat logs that triggered a specific story, filterable by the 's name</td><td></td></tr><tr><td>Sentiment</td><td>Find all chat logs from message with a positive, neutral, or negative sentiment</td><td></td></tr></tbody></table>

### Filtering and Exporting Chat Logs

Filter chat logs by clicking on **add filter** and selecting the appropriate attribute and function for the search parameter. To export filtered logs, click on **Select Action** and **Export rows to CSV**.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FhIaTVORZ6Sa6usXS6KXZ%2Fdownload.gif?alt=media&#x26;token=848f129c-9f5c-4ed5-a4c6-5f19f11c6586" alt=""><figcaption><p>Example of using Message View</p></figcaption></figure>

In the Example above, we are filtering all messages before 27th June 2024 containing message text 'gelato' then exporting those messages to a UAT.

Export filtered messages to CSV can be done in two ways by using Action >  **Export to CSV** or **Export to UAT.**\
\
**Export to CSV** will generate a .csv file with the following fields:

<table><thead><tr><th width="239">Fields</th><th>Description</th></tr></thead><tbody><tr><td>ID</td><td>An identifier based on the unique Message ID.</td></tr><tr><td>Date [Timezone]</td><td>This column reflects the timezone of the user exporting the data. For example, if the export is generated in New York, the column will show 'Date [GMT-05:00]'.</td></tr><tr><td>From</td><td>The source or type of user initiating the interaction such as user or bot.</td></tr><tr><td>From ID</td><td>A unique identifier for the sender such as user ID or bot ID.</td></tr><tr><td>From Name</td><td>Displays only the sender's display name.</td></tr><tr><td>Message</td><td>The content of the message exchanged during the interaction.</td></tr><tr><td>Reached Fallback</td><td>Indicates whether the interaction triggered a fallback response where "Y" stands for yes or "N" for no.</td></tr><tr><td>Story ID</td><td>A unique identifier for the story associated with the interaction.</td></tr><tr><td>Story Name</td><td>The name or title of the story.</td></tr><tr><td>Sentiment Value</td><td>A numerical score representing the sentiment of the user's message ranging from -1 for negative, 0 for neutral, and 1 for positive.</td></tr><tr><td>Sentiment</td><td>The sentiment category derived from the sentiment value such as positive, neutral, or negative.</td></tr><tr><td>Channel</td><td>The platform or medium through which the interaction occurred.</td></tr><tr><td>Widget ID</td><td>Only applies to Website Bot Widgets and cannot be used for Messaging Apps.</td></tr><tr><td>Chat History Link</td><td>A URL or link to access the complete chat history for the interaction.</td></tr></tbody></table>

**Export to UAT** will generate a .csv file with the following fields:

<table><thead><tr><th width="240">Field</th><th>Description</th></tr></thead><tbody><tr><td>ID</td><td>An identifier based on the unique Message ID.</td></tr><tr><td>Description</td><td>The name or title of the story.</td></tr><tr><td>Message</td><td>The content of the message exchanged during the interaction.</td></tr><tr><td>Memory</td><td>This refers to the bot’s memory context and can be used to simulate data that the bot remembers from the user’s conversation.</td></tr><tr><td>User</td><td>This refers to the user context, enabling simulation of an existing user on BotDistrikt or a new user with attributes defined via variables.</td></tr><tr><td>Refresh</td><td>This acts as a caching identifier. When a response is retrieved, it is cached for 10 minutes. Changing this value forces the cache to clear and recomputes the response.</td></tr><tr><td>Expected Response</td><td>The anticipated output or behaviour from the bot for the given input and context.</td></tr><tr><td>Actual Response</td><td>The actual output or behaviour observed from the system during the test.</td></tr><tr><td>Actual = Expected? (Y/N):</td><td>A validation field to confirm if the actual response matches the expected response.</td></tr><tr><td>Developer Comments</td><td>Additional notes or observations from the developer regarding the test case or discrepancies found.</td></tr></tbody></table>

{% hint style="info" %}
This is useful for generating extensive end-to-end automated regression tests for the chatbot using the BotDistrikt Auto-UAT Feature, available to Enterprise customers only. Please get in touch with <hello@botdistrikt.com>.
{% endhint %}

### Viewing the Sources of the bot's responses

The viewing of sources would provides context-aware answers to user queries. To enable this feature, you must first connect an LLM integration, such as OpenAI or other supported models followed by training the LLM using relevant [**Sources**](https://docs.botdistrikt.com/features/sources).&#x20;

Each generated response includes a **confidence level**, which indicates how certain the model is about the accuracy of the response based on the provided sources.

* Higher confidence: Indicates a high similarity score between the user’s message and retrieved sources. However, this does not mean the response is relevant.
* Lower confidence: Indicates a low similarity score between the user’s message and retrieved sources. However, this does not mean the response is irrelevant.

You can view generated response from the Messages tab by hovering over the generated response text and clicking view responses.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FbeeSxIAeS72PdoLTkN1N%2FUntitled%20design.gif?alt=media&#x26;token=00b7296f-b072-41fd-9fa4-fb13933b04f4" alt=""><figcaption><p>Viewing Generated Responses</p></figcaption></figure>

You can also view the sources to determine how the information is being derived from. This will bring you to the source material.
