-
Notifications
You must be signed in to change notification settings - Fork 0
/
chabot_architecture.html
192 lines (188 loc) · 6.59 KB
/
chabot_architecture.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chatbot Architecture Diagram</title>
<script src="https://unpkg.com/lucide@latest"></script>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
.container {
background-color: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: 95%;
max-width: 1200px;
overflow-x: auto;
}
.diagram {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
min-width: 800px;
}
.node {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px;
cursor: pointer;
transition: transform 0.2s;
width: 100px;
height: 100px;
text-align: center;
}
.node:hover {
transform: scale(1.1);
}
.circle {
border-radius: 50%;
}
.rectangle {
border-radius: 10px;
}
.diamond {
transform: rotate(45deg);
}
.diamond > * {
transform: rotate(-45deg);
}
.arrow {
flex-grow: 0;
width: 40px;
height: 2px;
background-color: #888;
position: relative;
}
.arrow::after {
content: '';
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 0;
height: 0;
border-left: 6px solid #888;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
}
.bidirectional::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 0;
height: 0;
border-right: 6px solid #888;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
}
.details {
margin-top: 20px;
padding: 10px;
background-color: #f8f8f8;
border-radius: 8px;
display: none;
}
.tool-list {
margin-top: 10px;
padding-left: 20px;
}
.node i {
font-size: 24px;
margin-bottom: 5px;
}
.node span {
font-size: 12px;
max-width: 90px;
word-wrap: break-word;
}
</style>
</head>
<body>
<div class="container">
<h2>Chatbot Application Architecture</h2>
<div class="diagram">
<div class="node circle" style="background-color: #ffcccc;" onclick="showDetails('customer')">
<i data-lucide="user"></i>
<span>Customer</span>
</div>
<div class="arrow"></div>
<div class="node rectangle" style="background-color: #ccecff;" onclick="showDetails('interface')">
<i data-lucide="message-square"></i>
<span>Chatbot Interface</span>
</div>
<div class="arrow bidirectional"></div>
<div class="node diamond" style="background-color: #ccffcc;" onclick="showDetails('llm')">
<i data-lucide="cpu"></i>
<span>LLM with Tools</span>
</div>
<div class="arrow bidirectional"></div>
<div class="node circle" style="background-color: #ffe0cc;" onclick="showDetails('database')">
<i data-lucide="database"></i>
<span>Cloud Database</span>
</div>
<div class="arrow bidirectional"></div>
<div class="node rectangle" style="background-color: #e6ccff;" onclick="showDetails('restaurant')">
<i data-lucide="utensils"></i>
<span>Restaurant App</span>
</div>
</div>
<div id="details" class="details"></div>
</div>
<script>
lucide.createIcons();
const details = {
customer: "The starting point of interaction. Customers initiate conversations and place orders.",
interface: "Handles user inputs and displays responses. It's the bridge between the customer and the LLM, with bidirectional communication.",
llm: "Processes queries and uses various tools to fulfill customer requests. It performs CRUD operations on the database and communicates bidirectionally with the Chatbot Interface.",
database: "Stores all relevant data including customer information, orders, and menu items. It's accessed by both the LLM and the Restaurant App for CRUD operations.",
restaurant: "Manages orders, inventory, and payments. It's the backend system for restaurant operations, performing CRUD operations on the database. It updates the database when payments are processed, food is prepared, and orders are delivered. It also handles transaction processing and payment confirmations."
};
const tools = [
'create_or_update_customer',
'check_customer_exists',
'fetch_customer_orders',
'get_menu_categories',
'get_menu_items',
'add_to_cart',
'view_cart',
'update_cart_item',
'place_order',
'update_customer_address',
'get_order_status'
];
function showDetails(node) {
const detailsElement = document.getElementById('details');
if (node === 'llm') {
detailsElement.innerHTML = `
<h3>Details for ${node}:</h3>
<p>${details[node]}</p>
<h4>Available Tools:</h4>
<ul class="tool-list">
${tools.map(tool => `<li>${tool}</li>`).join('')}
</ul>
`;
} else {
detailsElement.innerHTML = `
<h3>Details for ${node}:</h3>
<p>${details[node]}</p>
`;
}
detailsElement.style.display = 'block';
}
</script>
</body>
</html>