<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ app_name }}</title>
    {% if favicon %}
        <link rel="icon" href="{{ favicon }}">
    {% else %}
        <link rel="icon" type="image/png" href="{{ url_for('maeser.static', filename='maeser.png') }}">
    {% endif %}    
    <link rel="stylesheet" href="{{ url_for('maeser.static', filename='styles.css') }}">
</head>
<body>
    <!--
    © 2024 Carson Bush, Blaine Freestone

    This file is part of Maeser.

    Maeser is free software: you can redistribute it and/or modify it under the terms of
    the GNU Lesser General Public License as published by the Free Software Foundation,
    either version 3 of the License, or (at your option) any later version.

    Maeser is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    PURPOSE. See the GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License along with
    Maeser. If not, see <https://www.gnu.org/licenses/>.
    -->

    <b>Name: {{real_name}}</b>
    <b>User Authentication: {{user_name}}</b>
    <b>Time: {{time}}</b>
    <b>Branch: {{branch}}</b>
    <b>Total Cost: ${{total_cost}}</b>
    <b>Total Tokens: {{total_tokens}}</b>
    <hr style="color: black;width: 97%;margin: 1rem;">
    {% if messages is not none %}
        {% for message in messages %}
            {{ message['content'] | safe }}
            {% if message['role'] == 'system' %}
                <b style="margin-top: 1rem">Cost: ${{ message['cost'] }}</b>
                <b>Tokens: {{ message['tokens_used'] }}</b>
                <b>Time to Response: {{ message['execution_time'] }} seconds</b>
                {% if 'liked' in message %}
                    <b>
                        Feedback: {{ 'Positive' if message['liked'] else 'Negative' }}
                    </b>
                {% endif %}
            {% endif %}
            <hr style="color: black;width: 97%;margin: 1rem;">
        {% endfor %}
    {% else %}
        <p>No messages in this conversation.</p>
    {% endif %}
    <br>
    <a href="{{ url_for('maeser.logs') }}", style="margin-top: 2rem">Back to list</a>
</body>
</html>

