@liip/liipgpt 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,90 @@
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.0" />
6
+ <title>LiipGPT Preview</title>
7
+ </head>
8
+ <body>
9
+ <div id="body">
10
+ <div id="sidebar"></div>
11
+ </div>
12
+
13
+ <script src="./liipgpt-chat.iife.js"></script>
14
+ <script>
15
+ const orgs = ["alva","default","liipgpt"];
16
+
17
+ const sidebar = document.getElementById('sidebar');
18
+
19
+ orgs.forEach((org) => {
20
+ const button = document.createElement('button');
21
+ button.onclick = () => setOrg(org);
22
+ button.textContent = org;
23
+ sidebar.appendChild(button);
24
+ });
25
+
26
+ let chat;
27
+
28
+ function setOrg(org) {
29
+ chat?.remove();
30
+
31
+ chat = document.createElement('liipgpt-chat');
32
+ chat.id = 'chat';
33
+ chat.setAttribute('org', org);
34
+ chat.setAttribute('apiUrl', 'https://liipgpt-api.gpt.liip.ch/liipgpt');
35
+ chat.setAttribute('apiKey', 'X9hL4Gp5W2D7eRtF');
36
+ document.getElementById('body').appendChild(chat);
37
+
38
+ window.history.pushState({}, '', `?org=${org}`);
39
+ }
40
+
41
+ const params = new URLSearchParams(window.location.search);
42
+ setOrg(params.get('org') || 'liipgpt');
43
+ </script>
44
+
45
+ <style>
46
+ html,
47
+ body {
48
+ margin: 0;
49
+ padding: 0;
50
+ width: 100%;
51
+ height: 100%;
52
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
53
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
54
+ }
55
+
56
+ #body {
57
+ display: flex;
58
+ flex-direction: row;
59
+ width: 100%;
60
+ }
61
+
62
+ #sidebar {
63
+ display: flex;
64
+ flex-direction: column;
65
+ gap: 8px;
66
+ padding: 16px;
67
+ background-color: #f5f5f5;
68
+ border-right: 1px solid #ddd;
69
+ min-width: 150px;
70
+ height: 100vh;
71
+ }
72
+
73
+ liipgpt-chat {
74
+ flex: 1;
75
+ }
76
+
77
+ #sidebar button {
78
+ padding: 8px 16px;
79
+ border: 1px solid #ddd;
80
+ border-radius: 4px;
81
+ background-color: white;
82
+ cursor: pointer;
83
+ transition: background-color 0.2s;
84
+ }
85
+ #sidebar button:hover {
86
+ background-color: #eee;
87
+ }
88
+ </style>
89
+ </body>
90
+ </html>