alaselababatunde commited on
Commit
f7a7f9c
·
1 Parent(s): edeea8b
requirements.txt CHANGED
@@ -11,5 +11,6 @@ pandas
11
  sentence-transformers
12
  chromadb
13
  langchain-community
14
- python-dotenvlangchain-openai
 
15
  duckduckgo-search
 
11
  sentence-transformers
12
  chromadb
13
  langchain-community
14
+ python-dotenv
15
+ langchain-openai
16
  duckduckgo-search
{assests → static/assests}/logo.png RENAMED
File without changes
templates/index.html CHANGED
@@ -1,5 +1,6 @@
1
  <!DOCTYPE html>
2
  <html lang="en">
 
3
  <head>
4
  <meta charset="UTF-8" />
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -7,20 +8,23 @@
7
  <link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}" />
8
  <link rel="icon" href="{{ url_for('static', filename='assests/logo.png') }}" type="image/png">
9
  </head>
 
10
  <body>
11
  <div class="chat-container">
12
  <div class="chat-header">
13
- <h2><img src="/assests/logo.png" alt="Domino's Logo"> Domino's AI Support</h2>
14
- <button onclick="clearChat()" style="background: transparent; border: none; color: var(--dominos-red); cursor: pointer; font-weight: bold;">Clear Chat</button>
 
 
15
  </div>
16
 
17
  <div class="chat-box" id="chat-box">
18
  {% for message in chat_history %}
19
- <div class="message user slide-in-bottom">{{ message.user }}</div>
20
- <div class="message bot slide-in-bottom">
21
- <img src="/assests/logo.png" class="bot-logo" alt="Domino's">
22
- {{ message.bot|safe }}
23
- </div>
24
  {% endfor %}
25
  </div>
26
 
@@ -43,10 +47,10 @@
43
  });
44
 
45
  async function clearChat() {
46
- if (confirm('Are you sure you want to clear the pizza party? (Chat history)')) {
47
- await fetch('/clear', { method: 'POST' });
48
- window.location.reload();
49
- }
50
  }
51
 
52
  chatForm.addEventListener('submit', async (e) => {
@@ -71,7 +75,7 @@
71
  const botMessage = document.createElement('div');
72
  botMessage.classList.add('message', 'bot', 'slide-in-bottom');
73
  botMessage.innerHTML = `
74
- <img src="/assests/logo.png" class="bot-logo" alt="Domino's">
75
  <div class="thinking-container">
76
  <div class="thinking-dot"></div>
77
  <div class="thinking-dot"></div>
@@ -91,16 +95,17 @@
91
  const data = await res.json();
92
 
93
  // Replace thinking animation with bot response
94
- botMessage.innerHTML = `<img src="/assests/logo.png" class="bot-logo" alt="Domino's"> ${data.response || data.error}`;
95
  botMessage.scrollIntoView({ block: "start", behavior: "smooth" });
96
  } catch (err) {
97
- botMessage.innerHTML = `<img src="/assests/logo.png" class="bot-logo" alt="Domino's"> Sorry, something went wrong in the kitchen.`;
98
  } finally {
99
- input.disabled = false;
100
- sendBtn.disabled = false;
101
- input.focus();
102
  }
103
  });
104
  </script>
105
  </body>
106
- </html>
 
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
+
4
  <head>
5
  <meta charset="UTF-8" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
 
8
  <link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}" />
9
  <link rel="icon" href="{{ url_for('static', filename='assests/logo.png') }}" type="image/png">
10
  </head>
11
+
12
  <body>
13
  <div class="chat-container">
14
  <div class="chat-header">
15
+ <h2><img src="/static/assests/logo.png" alt="Domino's Logo"> Domino's AI Support</h2>
16
+ <button onclick="clearChat()"
17
+ style="background: transparent; border: none; color: var(--dominos-red); cursor: pointer; font-weight: bold;">Clear
18
+ Chat</button>
19
  </div>
20
 
21
  <div class="chat-box" id="chat-box">
22
  {% for message in chat_history %}
23
+ <div class="message user slide-in-bottom">{{ message.user }}</div>
24
+ <div class="message bot slide-in-bottom">
25
+ <img src="/static/assests/logo.png" class="bot-logo" alt="Domino's">
26
+ {{ message.bot|safe }}
27
+ </div>
28
  {% endfor %}
29
  </div>
30
 
 
47
  });
48
 
49
  async function clearChat() {
50
+ if (confirm('Are you sure you want to clear the pizza party? (Chat history)')) {
51
+ await fetch('/clear', { method: 'POST' });
52
+ window.location.reload();
53
+ }
54
  }
55
 
56
  chatForm.addEventListener('submit', async (e) => {
 
75
  const botMessage = document.createElement('div');
76
  botMessage.classList.add('message', 'bot', 'slide-in-bottom');
77
  botMessage.innerHTML = `
78
+ <img src="/static/assests/logo.png" class="bot-logo" alt="Domino's">
79
  <div class="thinking-container">
80
  <div class="thinking-dot"></div>
81
  <div class="thinking-dot"></div>
 
95
  const data = await res.json();
96
 
97
  // Replace thinking animation with bot response
98
+ botMessage.innerHTML = `<img src="/static/assests/logo.png" class="bot-logo" alt="Domino's"> ${data.response || data.error}`;
99
  botMessage.scrollIntoView({ block: "start", behavior: "smooth" });
100
  } catch (err) {
101
+ botMessage.innerHTML = `<img src="/static/assests/logo.png" class="bot-logo" alt="Domino's"> Sorry, something went wrong in the kitchen.`;
102
  } finally {
103
+ input.disabled = false;
104
+ sendBtn.disabled = false;
105
+ input.focus();
106
  }
107
  });
108
  </script>
109
  </body>
110
+
111
+ </html>