Create templates/index.py
Browse files- templates/index.py +44 -0
templates/index.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="fr">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>Mariam AI!</title>
|
6 |
+
<style>
|
7 |
+
body { font-family: Arial, sans-serif; margin: 2em; }
|
8 |
+
.chat-message { margin-bottom: 1em; padding: 0.5em; border: 1px solid #ccc; border-radius: 5px; }
|
9 |
+
.user { background-color: #e0f7fa; }
|
10 |
+
.assistant { background-color: #f1f8e9; }
|
11 |
+
.settings { margin-bottom: 2em; }
|
12 |
+
</style>
|
13 |
+
</head>
|
14 |
+
<body>
|
15 |
+
<h1>Mariam AI!</h1>
|
16 |
+
|
17 |
+
<div class="settings">
|
18 |
+
<form action="{{ url_for('index') }}" method="post" enctype="multipart/form-data">
|
19 |
+
<label for="toggle_web_search">Activer la recherche web :</label>
|
20 |
+
<input type="checkbox" name="toggle_web_search" id="toggle_web_search" {% if web_search %}checked{% endif %}>
|
21 |
+
<br><br>
|
22 |
+
<label for="file">Télécharger un fichier (image/document) :</label>
|
23 |
+
<input type="file" name="file" id="file" accept=".jpg,.jpeg,.png,.mp4,.mp3,.pdf,.txt">
|
24 |
+
<br><br>
|
25 |
+
<label for="prompt">Hey ?</label>
|
26 |
+
<input type="text" name="prompt" id="prompt" required style="width: 60%;">
|
27 |
+
<br><br>
|
28 |
+
<button type="submit">Envoyer</button>
|
29 |
+
</form>
|
30 |
+
</div>
|
31 |
+
|
32 |
+
<hr>
|
33 |
+
|
34 |
+
<div>
|
35 |
+
<h2>Historique du Chat</h2>
|
36 |
+
{% for msg in chat_history %}
|
37 |
+
<div class="chat-message {{ msg.role }}">
|
38 |
+
<strong>{{ msg.role|capitalize }} :</strong>
|
39 |
+
<p>{{ msg.message|safe }}</p>
|
40 |
+
</div>
|
41 |
+
{% endfor %}
|
42 |
+
</div>
|
43 |
+
</body>
|
44 |
+
</html>
|