open-swarm 0.1.1743070217__py3-none-any.whl → 0.1.1743362777__py3-none-any.whl

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.
Files changed (217) hide show
  1. open_swarm-0.1.1743362777.dist-info/METADATA +217 -0
  2. open_swarm-0.1.1743362777.dist-info/RECORD +260 -0
  3. {open_swarm-0.1.1743070217.dist-info → open_swarm-0.1.1743362777.dist-info}/WHEEL +1 -2
  4. open_swarm-0.1.1743362777.dist-info/entry_points.txt +2 -0
  5. swarm/__init__.py +0 -2
  6. swarm/auth.py +53 -49
  7. swarm/blueprints/README.md +67 -0
  8. swarm/blueprints/burnt_noodles/blueprint_burnt_noodles.py +412 -0
  9. swarm/blueprints/chatbot/blueprint_chatbot.py +98 -0
  10. swarm/blueprints/chatbot/templates/chatbot/chatbot.html +33 -0
  11. swarm/blueprints/digitalbutlers/blueprint_digitalbutlers.py +183 -0
  12. swarm/blueprints/dilbot_universe/blueprint_dilbot_universe.py +285 -0
  13. swarm/blueprints/divine_code/__init__.py +0 -0
  14. swarm/blueprints/divine_code/apps.py +11 -0
  15. swarm/blueprints/divine_code/blueprint_divine_code.py +219 -0
  16. swarm/blueprints/django_chat/apps.py +6 -0
  17. swarm/blueprints/django_chat/blueprint_django_chat.py +84 -0
  18. swarm/blueprints/django_chat/templates/django_chat/django_chat_webpage.html +37 -0
  19. swarm/blueprints/django_chat/urls.py +8 -0
  20. swarm/blueprints/django_chat/views.py +32 -0
  21. swarm/blueprints/echocraft/blueprint_echocraft.py +44 -0
  22. swarm/blueprints/family_ties/apps.py +11 -0
  23. swarm/blueprints/family_ties/blueprint_family_ties.py +152 -0
  24. swarm/blueprints/family_ties/models.py +19 -0
  25. swarm/blueprints/family_ties/serializers.py +7 -0
  26. swarm/blueprints/family_ties/settings.py +16 -0
  27. swarm/blueprints/family_ties/urls.py +10 -0
  28. swarm/blueprints/family_ties/views.py +26 -0
  29. swarm/blueprints/flock/__init__.py +0 -0
  30. swarm/blueprints/gaggle/blueprint_gaggle.py +184 -0
  31. swarm/blueprints/gotchaman/blueprint_gotchaman.py +232 -0
  32. swarm/blueprints/mcp_demo/blueprint_mcp_demo.py +133 -0
  33. swarm/blueprints/messenger/templates/messenger/messenger.html +46 -0
  34. swarm/blueprints/mission_improbable/blueprint_mission_improbable.py +234 -0
  35. swarm/blueprints/monkai_magic/blueprint_monkai_magic.py +248 -0
  36. swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py +156 -0
  37. swarm/blueprints/omniplex/blueprint_omniplex.py +221 -0
  38. swarm/blueprints/rue_code/__init__.py +0 -0
  39. swarm/blueprints/rue_code/blueprint_rue_code.py +291 -0
  40. swarm/blueprints/suggestion/blueprint_suggestion.py +110 -0
  41. swarm/blueprints/unapologetic_press/blueprint_unapologetic_press.py +298 -0
  42. swarm/blueprints/whiskeytango_foxtrot/__init__.py +0 -0
  43. swarm/blueprints/whiskeytango_foxtrot/apps.py +11 -0
  44. swarm/blueprints/whiskeytango_foxtrot/blueprint_whiskeytango_foxtrot.py +256 -0
  45. swarm/extensions/blueprint/__init__.py +30 -15
  46. swarm/extensions/blueprint/agent_utils.py +16 -40
  47. swarm/extensions/blueprint/blueprint_base.py +141 -543
  48. swarm/extensions/blueprint/blueprint_discovery.py +112 -98
  49. swarm/extensions/blueprint/cli_handler.py +185 -0
  50. swarm/extensions/blueprint/config_loader.py +122 -0
  51. swarm/extensions/blueprint/django_utils.py +181 -79
  52. swarm/extensions/blueprint/interactive_mode.py +1 -1
  53. swarm/extensions/config/config_loader.py +83 -200
  54. swarm/extensions/launchers/build_swarm_wrapper.py +0 -0
  55. swarm/extensions/launchers/swarm_cli.py +199 -287
  56. swarm/llm/chat_completion.py +26 -55
  57. swarm/management/__init__.py +0 -0
  58. swarm/management/commands/__init__.py +0 -0
  59. swarm/management/commands/runserver.py +58 -0
  60. swarm/permissions.py +38 -0
  61. swarm/serializers.py +96 -5
  62. swarm/settings.py +95 -110
  63. swarm/static/contrib/fonts/fontawesome-webfont.ttf +7 -0
  64. swarm/static/contrib/fonts/fontawesome-webfont.woff +7 -0
  65. swarm/static/contrib/fonts/fontawesome-webfont.woff2 +7 -0
  66. swarm/static/contrib/markedjs/marked.min.js +6 -0
  67. swarm/static/contrib/tabler-icons/adjustments-horizontal.svg +27 -0
  68. swarm/static/contrib/tabler-icons/alert-triangle.svg +21 -0
  69. swarm/static/contrib/tabler-icons/archive.svg +21 -0
  70. swarm/static/contrib/tabler-icons/artboard.svg +27 -0
  71. swarm/static/contrib/tabler-icons/automatic-gearbox.svg +23 -0
  72. swarm/static/contrib/tabler-icons/box-multiple.svg +19 -0
  73. swarm/static/contrib/tabler-icons/carambola.svg +19 -0
  74. swarm/static/contrib/tabler-icons/copy.svg +20 -0
  75. swarm/static/contrib/tabler-icons/download.svg +21 -0
  76. swarm/static/contrib/tabler-icons/edit.svg +21 -0
  77. swarm/static/contrib/tabler-icons/filled/carambola.svg +13 -0
  78. swarm/static/contrib/tabler-icons/filled/paint.svg +13 -0
  79. swarm/static/contrib/tabler-icons/headset.svg +22 -0
  80. swarm/static/contrib/tabler-icons/layout-sidebar-left-collapse.svg +21 -0
  81. swarm/static/contrib/tabler-icons/layout-sidebar-left-expand.svg +21 -0
  82. swarm/static/contrib/tabler-icons/layout-sidebar-right-collapse.svg +21 -0
  83. swarm/static/contrib/tabler-icons/layout-sidebar-right-expand.svg +21 -0
  84. swarm/static/contrib/tabler-icons/message-chatbot.svg +22 -0
  85. swarm/static/contrib/tabler-icons/message-star.svg +22 -0
  86. swarm/static/contrib/tabler-icons/message-x.svg +23 -0
  87. swarm/static/contrib/tabler-icons/message.svg +21 -0
  88. swarm/static/contrib/tabler-icons/paperclip.svg +18 -0
  89. swarm/static/contrib/tabler-icons/playlist-add.svg +22 -0
  90. swarm/static/contrib/tabler-icons/robot.svg +26 -0
  91. swarm/static/contrib/tabler-icons/search.svg +19 -0
  92. swarm/static/contrib/tabler-icons/settings.svg +20 -0
  93. swarm/static/contrib/tabler-icons/thumb-down.svg +19 -0
  94. swarm/static/contrib/tabler-icons/thumb-up.svg +19 -0
  95. swarm/static/css/dropdown.css +22 -0
  96. swarm/static/htmx/htmx.min.js +0 -0
  97. swarm/static/js/dropdown.js +23 -0
  98. swarm/static/rest_mode/css/base.css +470 -0
  99. swarm/static/rest_mode/css/chat-history.css +286 -0
  100. swarm/static/rest_mode/css/chat.css +251 -0
  101. swarm/static/rest_mode/css/chatbot.css +74 -0
  102. swarm/static/rest_mode/css/chatgpt.css +62 -0
  103. swarm/static/rest_mode/css/colors/corporate.css +74 -0
  104. swarm/static/rest_mode/css/colors/pastel.css +81 -0
  105. swarm/static/rest_mode/css/colors/tropical.css +82 -0
  106. swarm/static/rest_mode/css/general.css +142 -0
  107. swarm/static/rest_mode/css/layout.css +167 -0
  108. swarm/static/rest_mode/css/layouts/messenger-layout.css +17 -0
  109. swarm/static/rest_mode/css/layouts/minimalist-layout.css +57 -0
  110. swarm/static/rest_mode/css/layouts/mobile-layout.css +8 -0
  111. swarm/static/rest_mode/css/messages.css +84 -0
  112. swarm/static/rest_mode/css/messenger.css +135 -0
  113. swarm/static/rest_mode/css/settings.css +91 -0
  114. swarm/static/rest_mode/css/simple.css +44 -0
  115. swarm/static/rest_mode/css/slack.css +58 -0
  116. swarm/static/rest_mode/css/style.css +156 -0
  117. swarm/static/rest_mode/css/theme.css +30 -0
  118. swarm/static/rest_mode/css/toast.css +40 -0
  119. swarm/static/rest_mode/js/auth.js +9 -0
  120. swarm/static/rest_mode/js/blueprint.js +41 -0
  121. swarm/static/rest_mode/js/blueprintUtils.js +12 -0
  122. swarm/static/rest_mode/js/chatLogic.js +79 -0
  123. swarm/static/rest_mode/js/debug.js +63 -0
  124. swarm/static/rest_mode/js/events.js +98 -0
  125. swarm/static/rest_mode/js/main.js +19 -0
  126. swarm/static/rest_mode/js/messages.js +264 -0
  127. swarm/static/rest_mode/js/messengerLogic.js +355 -0
  128. swarm/static/rest_mode/js/modules/apiService.js +84 -0
  129. swarm/static/rest_mode/js/modules/blueprintManager.js +162 -0
  130. swarm/static/rest_mode/js/modules/chatHistory.js +110 -0
  131. swarm/static/rest_mode/js/modules/debugLogger.js +14 -0
  132. swarm/static/rest_mode/js/modules/eventHandlers.js +107 -0
  133. swarm/static/rest_mode/js/modules/messageProcessor.js +120 -0
  134. swarm/static/rest_mode/js/modules/state.js +7 -0
  135. swarm/static/rest_mode/js/modules/userInteractions.js +29 -0
  136. swarm/static/rest_mode/js/modules/validation.js +23 -0
  137. swarm/static/rest_mode/js/rendering.js +119 -0
  138. swarm/static/rest_mode/js/settings.js +130 -0
  139. swarm/static/rest_mode/js/sidebar.js +94 -0
  140. swarm/static/rest_mode/js/simpleLogic.js +37 -0
  141. swarm/static/rest_mode/js/slackLogic.js +66 -0
  142. swarm/static/rest_mode/js/splash.js +76 -0
  143. swarm/static/rest_mode/js/theme.js +111 -0
  144. swarm/static/rest_mode/js/toast.js +36 -0
  145. swarm/static/rest_mode/js/ui.js +265 -0
  146. swarm/static/rest_mode/js/validation.js +57 -0
  147. swarm/static/rest_mode/svg/animated_spinner.svg +12 -0
  148. swarm/static/rest_mode/svg/arrow_down.svg +5 -0
  149. swarm/static/rest_mode/svg/arrow_left.svg +5 -0
  150. swarm/static/rest_mode/svg/arrow_right.svg +5 -0
  151. swarm/static/rest_mode/svg/arrow_up.svg +5 -0
  152. swarm/static/rest_mode/svg/attach.svg +8 -0
  153. swarm/static/rest_mode/svg/avatar.svg +7 -0
  154. swarm/static/rest_mode/svg/canvas.svg +6 -0
  155. swarm/static/rest_mode/svg/chat_history.svg +4 -0
  156. swarm/static/rest_mode/svg/close.svg +5 -0
  157. swarm/static/rest_mode/svg/copy.svg +4 -0
  158. swarm/static/rest_mode/svg/dark_mode.svg +3 -0
  159. swarm/static/rest_mode/svg/edit.svg +5 -0
  160. swarm/static/rest_mode/svg/layout.svg +9 -0
  161. swarm/static/rest_mode/svg/logo.svg +29 -0
  162. swarm/static/rest_mode/svg/logout.svg +5 -0
  163. swarm/static/rest_mode/svg/mobile.svg +5 -0
  164. swarm/static/rest_mode/svg/new_chat.svg +4 -0
  165. swarm/static/rest_mode/svg/not_visible.svg +5 -0
  166. swarm/static/rest_mode/svg/plus.svg +7 -0
  167. swarm/static/rest_mode/svg/run_code.svg +6 -0
  168. swarm/static/rest_mode/svg/save.svg +4 -0
  169. swarm/static/rest_mode/svg/search.svg +6 -0
  170. swarm/static/rest_mode/svg/settings.svg +4 -0
  171. swarm/static/rest_mode/svg/speaker.svg +5 -0
  172. swarm/static/rest_mode/svg/stop.svg +6 -0
  173. swarm/static/rest_mode/svg/thumbs_down.svg +3 -0
  174. swarm/static/rest_mode/svg/thumbs_up.svg +3 -0
  175. swarm/static/rest_mode/svg/toggle_off.svg +6 -0
  176. swarm/static/rest_mode/svg/toggle_on.svg +6 -0
  177. swarm/static/rest_mode/svg/trash.svg +10 -0
  178. swarm/static/rest_mode/svg/undo.svg +3 -0
  179. swarm/static/rest_mode/svg/visible.svg +8 -0
  180. swarm/static/rest_mode/svg/voice.svg +10 -0
  181. swarm/templates/account/login.html +22 -0
  182. swarm/templates/account/signup.html +32 -0
  183. swarm/templates/base.html +30 -0
  184. swarm/templates/chat.html +43 -0
  185. swarm/templates/index.html +35 -0
  186. swarm/templates/rest_mode/components/chat_sidebar.html +55 -0
  187. swarm/templates/rest_mode/components/header.html +45 -0
  188. swarm/templates/rest_mode/components/main_chat_pane.html +41 -0
  189. swarm/templates/rest_mode/components/settings_dialog.html +97 -0
  190. swarm/templates/rest_mode/components/splash_screen.html +7 -0
  191. swarm/templates/rest_mode/components/top_bar.html +28 -0
  192. swarm/templates/rest_mode/message_ui.html +50 -0
  193. swarm/templates/rest_mode/slackbot.html +30 -0
  194. swarm/templates/simple_blueprint_page.html +24 -0
  195. swarm/templates/websocket_partials/final_system_message.html +3 -0
  196. swarm/templates/websocket_partials/system_message.html +4 -0
  197. swarm/templates/websocket_partials/user_message.html +5 -0
  198. swarm/urls.py +57 -74
  199. swarm/utils/log_utils.py +63 -0
  200. swarm/views/api_views.py +48 -39
  201. swarm/views/chat_views.py +156 -70
  202. swarm/views/core_views.py +85 -90
  203. swarm/views/model_views.py +64 -121
  204. swarm/views/utils.py +65 -441
  205. open_swarm-0.1.1743070217.dist-info/METADATA +0 -258
  206. open_swarm-0.1.1743070217.dist-info/RECORD +0 -89
  207. open_swarm-0.1.1743070217.dist-info/entry_points.txt +0 -3
  208. open_swarm-0.1.1743070217.dist-info/top_level.txt +0 -1
  209. swarm/agent/agent.py +0 -49
  210. swarm/core.py +0 -326
  211. swarm/extensions/mcp/__init__.py +0 -1
  212. swarm/extensions/mcp/cache_utils.py +0 -36
  213. swarm/extensions/mcp/mcp_client.py +0 -341
  214. swarm/extensions/mcp/mcp_constants.py +0 -7
  215. swarm/extensions/mcp/mcp_tool_provider.py +0 -110
  216. swarm/types.py +0 -126
  217. {open_swarm-0.1.1743070217.dist-info → open_swarm-0.1.1743362777.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,57 @@
1
+ // validation.js - Handles input validation
2
+
3
+ import { showToast } from './toast.js'; // Import the toast notification function
4
+
5
+ /**
6
+ * Validates a single message object.
7
+ * @param {object} message - The message object to validate.
8
+ * @returns {string|null} - Returns an error message string if invalid, otherwise null.
9
+ */
10
+ function validateMessage(message) {
11
+ if (!message || typeof message !== 'object') {
12
+ showToast("Invalid message format.", "error");
13
+ return "Invalid message format.";
14
+ }
15
+
16
+ const { role, content } = message;
17
+
18
+ if (!role || typeof role !== 'string') {
19
+ showToast("Message role is missing or invalid.", "error");
20
+ return "Message role is missing or invalid.";
21
+ }
22
+
23
+ if (!content || typeof content !== 'string') {
24
+ showToast("Message content is missing or invalid.", "error");
25
+ return "Message content is missing or invalid.";
26
+ }
27
+
28
+ // Additional validations can be added here
29
+
30
+ return null;
31
+ }
32
+
33
+ /**
34
+ * Validates the entire chat history.
35
+ * @param {Array} chatHistory - The array of message objects.
36
+ * @returns {string|null} - Returns an error message string if invalid, otherwise null.
37
+ */
38
+ function validateChatHistory(chatHistory) {
39
+ if (!Array.isArray(chatHistory)) {
40
+ showToast("Chat history is invalid.", "error");
41
+ return "Chat history is invalid.";
42
+ }
43
+
44
+ for (let message of chatHistory) {
45
+ const error = validateMessage(message);
46
+ if (error) {
47
+ return error;
48
+ }
49
+ }
50
+
51
+ return null;
52
+ }
53
+
54
+ export {
55
+ validateMessage,
56
+ validateChatHistory
57
+ }
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
2
+ <!-- Refined Spinner Circle -->
3
+ <circle cx="24" cy="24" r="20" fill="none" stroke="currentColor" stroke-width="4" stroke-dasharray="150 50">
4
+ <animateTransform
5
+ attributeName="transform"
6
+ type="rotate"
7
+ dur="1s"
8
+ from="0 24 24"
9
+ to="360 24 24"
10
+ repeatCount="indefinite"/>
11
+ </circle>
12
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M12 8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ <path d="M8 12l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M16 12H8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ <path d="M12 8l-4 4 4 4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M8 12h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ <path d="M12 8l4 4-4 4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M12 16V8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ <path d="M8 12l4-4 4 4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M12 7v7.5c0 1.5-1.5 2.5-2.5 2.5s-2.5-1-2.5-2.5V8c0-1 1-2 2-2s2 1 2 2v6"
4
+ fill="none"
5
+ stroke="currentColor"
6
+ stroke-width="2"
7
+ stroke-linecap="round"/>
8
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <circle cx="12" cy="12" r="12" stroke="currentColor" stroke-width="1" fill="none"/>
3
+ <!-- Head -->
4
+ <circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2"/>
5
+ <!-- Shoulders -->
6
+ <path d="M6 20c0-4 4-7 6-7s6 3 6 7" fill="none" stroke="currentColor" stroke-width="2"/>
7
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <rect x="3" y="3" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.5"/>
3
+ <path d="M15 7l-8 8M7 7l8 8" stroke="currentColor" stroke-width="1"/>
4
+ <path d="M18 6l-2-2 1-1 2 2z" fill="currentColor"/>
5
+ <path d="M7 17c0.5-0.5 2-2 2-2s0.5 1.5 0 2s-2 0-2 0z" fill="currentColor"/>
6
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M12 7v5l3 3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"/>
3
+ <line x1="8" y1="8" x2="16" y2="16" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ <line x1="16" y1="8" x2="8" y2="16" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <rect x="9" y="9" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M5 15H4V3h11v1" stroke="currentColor" stroke-width="2" fill="none"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path d="M21 12.79A9 9 0 1111.21 3a7 7 0 009.79 9.79z" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
2
+ <!-- A simpler pencil icon for a more recognizable 'edit' shape -->
3
+ <path d="M2 21l1.5-6.16a.5.5 0 0 1 .13-.26l12-12a2 2 0 0 1 2.83 0l2.83 2.83a2 2 0 0 1 0 2.83l-12 12a.5.5 0 0 1-.26.13L3 22H2v-1Z"/>
4
+ <path d="M12 7l5 5"/>
5
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <!-- Grid Layout -->
3
+ <rect x="3" y="3" width="6" height="6" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <rect x="15" y="3" width="6" height="6" fill="none" stroke="currentColor" stroke-width="2"/>
5
+ <rect x="3" y="15" width="6" height="6" fill="none" stroke="currentColor" stroke-width="2"/>
6
+ <rect x="15" y="15" width="6" height="6" fill="none" stroke="currentColor" stroke-width="2"/>
7
+ <line x1="3" y1="12" x2="21" y2="12" stroke="currentColor" stroke-width="2"/>
8
+ <line x1="12" y1="3" x2="12" y2="21" stroke="currentColor" stroke-width="2"/>
9
+ </svg>
@@ -0,0 +1,29 @@
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ viewBox="0 0 100 100"
4
+ class="logo"
5
+ role="img"
6
+ aria-label="Open-Swarm Logo"
7
+ >
8
+ <!-- Circle with dynamic fill -->
9
+ <circle
10
+ cx="50"
11
+ cy="50"
12
+ r="48"
13
+ fill="var(--bg-color, black)"
14
+ stroke="var(--text-color, white)"
15
+ stroke-width="4"
16
+ />
17
+ <!-- Text "OS" -->
18
+ <text
19
+ x="50%"
20
+ y="55%"
21
+ text-anchor="middle"
22
+ font-family="Arial, sans-serif"
23
+ font-size="36"
24
+ fill="var(--text-color, white)"
25
+ dy=".3em"
26
+ >
27
+ OS
28
+ </text>
29
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path d="M14 8v-2a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2v-2" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
3
+ <path d="M9 12h12l-3-3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ <path d="M18 15l3-3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
2
+ <!-- A simple mobile phone icon -->
3
+ <rect x="6" y="2" width="12" height="20" rx="2" ry="2" />
4
+ <path d="M11 19h2" />
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M12 8v6M9 11h6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
2
+ <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7 7 0 0 0-2.79.588l.77.771A6 6 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755q-.247.248-.517.486z"/>
3
+ <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829"/>
4
+ <path d="M3.35 5.47q-.27.24-.518.487A13 13 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7 7 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12z"/>
5
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <!-- Outer Circle -->
3
+ <circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Plus Sign -->
5
+ <line x1="12" y1="8" x2="12" y2="16" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
6
+ <line x1="8" y1="12" x2="16" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
7
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
2
+ <!-- Outer Circle -->
3
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Play Arrow -->
5
+ <polygon points="10,8 18,12 10,16" fill="currentColor"/>
6
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path d="M3 3v18h18V3H3zm14 2h2v6h-7V5h5zm-7 14H5v-7h12v7h-7z" fill="currentColor"/>
3
+ <rect x="15" y="5" width="2" height="2" fill="currentColor"/>
4
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 16 16">
2
+ <!-- Outer Circle -->
3
+ <circle cx="7" cy="7" r="5" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Handle -->
5
+ <line x1="11" y1="11" x2="15" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
6
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path d="M19.14,12.94a7.09,7.09,0,0,0,.06-1,7.09,7.09,0,0,0-.06-1l2.11-1.65a.5.5,0,0,0,.12-.65l-2-3.46a.5.5,0,0,0-.61-.22l-2.49,1a7,7,0,0,0-1.6-.94l-.38-2.65A.5.5,0,0,0,14.65,3H9.35a.5.5,0,0,0-.49.42L8.48,6.07a7,7,0,0,0-1.6.94l-2.49-1a.5.5,0,0,0-.61.22l-2,3.46a.5.5,0,0,0,.12.65l2.11,1.65a7.09,7.09,0,0,0-.06,1,7.09,7.09,0,0,0,.06,1L2.52,14.59a.5.5,0,0,0-.12.65l2,3.46a.5.5,0,0,0,.61.22l2.49-1a7,7,0,0,0,1.6.94l.38,2.65a.5.5,0,0,0,.49.42h5.3a.5.5,0,0,0,.49-.42l.38-2.65a7,7,0,0,0,1.6-.94l2.49,1a.5.5,0,0,0,.61-.22l2-3.46a.5.5,0,0,0-.12-.65Z" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <circle cx="12" cy="12" r="3" fill="currentColor"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path d="M12 5L8 9H4v6h4l4 4V5z" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M15.5 8a5 5 0 0 1 0 8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
4
+ <path d="M18 5a8 8 0 0 1 0 14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
5
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
2
+ <!-- Outer Circle -->
3
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Stop Square -->
5
+ <rect x="8" y="8" width="8" height="8" fill="currentColor" stroke="currentColor" stroke-width="2"/>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
2
+ <path d="M8.864 15.674c-.956.24-1.843-.484-1.908-1.42-.072-1.05-.23-2.015-.428-2.59-.125-.36-.479-1.012-1.04-1.638-.557-.624-1.282-1.179-2.131-1.41C2.685 8.432 2 7.85 2 7V3c0-.845.682-1.464 1.448-1.546 1.07-.113 1.564-.415 2.068-.723l.048-.029c.272-.166.578-.349.97-.484C6.931.08 7.395 0 8 0h3.5c.937 0 1.599.478 1.934 1.064.164.287.254.607.254.913 0 .152-.023.312-.077.464.201.262.38.577.488.9.11.33.172.762.004 1.15.069.13.12.268.159.403.077.27.113.567.113.856 0 .289-.036.586-.113.856-.035.12-.08.244-.138.363.394.571.418 1.2.234 1.733-.206.592-.682 1.1-1.2 1.272-.847.283-1.803.276-2.516.211a9.877 9.877 0 0 1-.443-.05 9.364 9.364 0 0 1-.062 4.51c-.138.508-.55.848-1.012.964zM11.5 1.6H8c-.51 0-.863.068-1.14.163-.281.097-.506.229-.776.393l-.04.025c-.555.338-1.198.73-2.49.868-.333.035-.554.29-.554.55v4.002c0 .255.226.543.62.65 1.095.3 1.977.997 2.614 1.709.635.71 1.064 1.475 1.238 1.977.243.7.407 1.768.482 2.85.025.362.36.595.667.518l.262-.065c.16-.04.258-.144.288-.255a8.34 8.34 0 0 0-.145-4.726.5.5 0 0 1 .595-.643h.003l.014.004.058.013a8.912 8.912 0 0 0 1.036.157c.663.06 1.457.054 2.11-.163.175-.059.45-.301.57-.651.107-.308.087-.67-.266-1.021l-.353-.354.353-.354c.043-.042.105-.14.154-.315.048-.167.075-.37.075-.581 0-.211-.027-.414-.075-.581-.05-.174-.111-.273-.154-.315L12.793 4l.353-.354c.047-.047.109-.176.005-.488a2.224 2.224 0 0 0-.505-.804l-.353-.354.353-.354c.006-.005.041-.05.041-.17a.866.866 0 0 0-.121-.415C12.4 1.272 12.063 1 11.5 1z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
2
+ <path d="M8.864.046C7.908-.193 7.02.53 6.956 1.466c-.072 1.051-.23 2.016-.428 2.59-.125.36-.479 1.013-1.04 1.639-.557.623-1.282 1.178-2.131 1.41C2.685 7.288 2 7.87 2 8.72v4.001c0 .845.682 1.464 1.448 1.545 1.07.114 1.564.415 2.068.723l.048.03c.272.165.578.348.97.484.397.136.861.217 1.466.217h3.5c.937 0 1.599-.477 1.934-1.064a1.86 1.86 0 0 0 .254-.912c0-.152-.023-.312-.077-.464.201-.263.38-.578.488-.901.11-.33.172-.762.004-1.149.069-.13.12-.269.159-.403.077-.27.113-.568.113-.857 0-.288-.036-.585-.113-.856a2 2 0 0 0-.138-.362 1.9 1.9 0 0 0 .234-1.734c-.206-.592-.682-1.1-1.2-1.272-.847-.282-1.803-.276-2.516-.211a10 10 0 0 0-.443.05 9.4 9.4 0 0 0-.062-4.509A1.38 1.38 0 0 0 9.125.111z"/>
3
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="24" viewBox="0 0 40 24">
2
+ <!-- Toggle Track -->
3
+ <rect x="2" y="2" width="36" height="20" rx="10" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Toggle Knob (Off Position) -->
5
+ <circle cx="12" cy="12" r="8" fill="currentColor" stroke="none"/>
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="24" viewBox="0 0 40 24">
2
+ <!-- Toggle Track -->
3
+ <rect x="2" y="2" width="36" height="20" rx="10" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Toggle Knob (On Position) -->
5
+ <circle cx="28" cy="12" r="8" fill="currentColor" stroke="none"/>
6
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
2
+ <!-- Trash Can Outline -->
3
+ <path d="M6 7v13a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Trash Can Lid -->
5
+ <path d="M4 7h16" stroke="currentColor" stroke-width="2"/>
6
+ <!-- Trash Can Handle -->
7
+ <path d="M10 5V3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2" fill="none" stroke="currentColor" stroke-width="2"/>
8
+ <!-- Trash Can Bins -->
9
+ <path d="M10 11v6M14 11v6" stroke="currentColor" stroke-width="2"/>
10
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path d="M12 5C7.582 5 4 8.582 4 13c0 4.418 3.582 8 8 8 4.418 0 8-3.582 8-8h-2c0 3.314-2.686 6-6 6-3.314 0-6-2.686-6-6 0-3.314 2.686-6 6-6 1.657 0 3.157.672 4.243 1.757L13 12h7V5l-2.929 2.929C15.584 6.442 13.872 5 12 5z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 16 16">
2
+ <!-- Refined Outer Eye Shape -->
3
+ <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8z" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Enhanced Iris -->
5
+ <circle cx="8" cy="8" r="3" fill="currentColor" stroke="none"/>
6
+ <!-- Sharper Pupil -->
7
+ <circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/>
8
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <!-- Outer Circle -->
3
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <!-- Sound Waves -->
5
+ <line x1="6" y1="12" x2="6" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
6
+ <line x1="9" y1="14" x2="9" y2="8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
7
+ <line x1="12" y1="18" x2="12" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
8
+ <line x1="15" y1="16" x2="15" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
9
+ <line x1="18" y1="14" x2="18" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
10
+ </svg>
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Login</title>
6
+ </head>
7
+ <body>
8
+ <h1>Login</h1>
9
+ {% if error %}
10
+ <p style="color: red;">{{ error }}</p>
11
+ {% endif %}
12
+ <form method="post" action="{% url 'custom_login' %}?next={{ request.GET.next }}">
13
+ {% csrf_token %}
14
+ <label for="username">Username:</label>
15
+ <input type="text" id="username" name="username" required><br>
16
+ <label for="password">Password:</label>
17
+ <input type="password" id="password" name="password" required><br>
18
+ <button type="submit">Login</button>
19
+ </form>
20
+ <p>Hint: Use "testuser" with password "testpass" for testing.</p>
21
+ </body>
22
+ </html>
@@ -0,0 +1,32 @@
1
+ {% extends "base.html" %}
2
+ {% load static %}
3
+
4
+ {% block head %}
5
+ <link rel="stylesheet" type="text/css" href="{% static 'css/custom.css' %}">
6
+ {% endblock %}
7
+
8
+ {% block content %}
9
+ <div class="container mt-5">
10
+ <div class="row justify-content-center">
11
+ <div class="col-md-6">
12
+ <div class="card login-card">
13
+ <div class="login-header text-center">
14
+ <h3>Sign Up - django_chat (open-swarm edition)</h3>
15
+ </div>
16
+ <div class="login-body">
17
+ <form method="post">
18
+ {% csrf_token %}
19
+ {{ form.as_p }}
20
+ <div class="text-center">
21
+ <button type="submit" class="btn btn-primary btn-block">Sign Up</button>
22
+ </div>
23
+ </form>
24
+ </div>
25
+ <div class="login-footer">
26
+ <p>Already have an account? <a href="{% url 'account_login' %}">Log in here</a>.</p>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ {% endblock %}
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ {% load static %}
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Open-Swarm</title>
8
+ <link href="{% static 'css/rest_mode_style.css' %}" rel="stylesheet">
9
+ <link href="{% static 'css/dropdown.css' %}" rel="stylesheet">
10
+ <script src="{% static 'js/htmx.min.js' %}"></script>
11
+ </head>
12
+ <body>
13
+ <header>
14
+ <nav class="navbar">
15
+ <a href="https://github.com/matthewhand/open-swarm" target="_blank">Open-Swarm</a>
16
+ </nav>
17
+ </header>
18
+ <main>
19
+ <div class="dropdown" hx-get="/v1/models" hx-trigger="click" hx-target="#blueprintDropdown" hx-swap="innerHTML">
20
+ <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton">
21
+ Select a Blueprint
22
+ </button>
23
+ <div class="dropdown-menu" id="blueprintDropdown">
24
+ <p class="dropdown-item disabled"></p>
25
+ </div>
26
+ </div>
27
+ {% block content %}{% endblock %}
28
+ </main>
29
+ </body>
30
+ </html>
@@ -0,0 +1,43 @@
1
+ {% extends 'base.html' %}
2
+
3
+ {% block content %}
4
+ <div class="text-center mb-4">
5
+ <h1 class="display-4">Chatbot</h1>
6
+ </div>
7
+ <div id="chatbot" hx-ext="ws" ws-connect="/ws/ai-demo/{{ conversation.id }}/" class="card">
8
+ <div class="card-body">
9
+ <div class="conversation" id="message-list">
10
+ {% if conversation.conversation %}
11
+ {% for message in conversation.conversation %}
12
+ <div class="{{ message.role }}-message chatbot-text-system mb-2">
13
+ {{ message.content }}
14
+ </div>
15
+ {% endfor %}
16
+ {% else %}
17
+ <div class="assistant-message chatbot-text-system mb-2">
18
+ Start a new conversation by sending a message.
19
+ </div>
20
+ {% endif %}
21
+ </div>
22
+ </div>
23
+ <div class="card-footer">
24
+ <form id="input-form" ws-send class="d-flex">
25
+ <input id="input-field" name="message" type="text" placeholder="Type your message here" class="form-control me-2">
26
+ <button id="submit-button" type="submit" class="btn btn-primary">
27
+ Send
28
+ </button>
29
+ </form>
30
+ </div>
31
+ </div>
32
+ <script>
33
+ // clear message input after sending our new message
34
+ document.body.addEventListener('htmx:wsAfterSend', function(evt) {
35
+ document.getElementById("input-field").value = "";
36
+ });
37
+ // scroll to bottom of chat after every incoming message
38
+ document.body.addEventListener('htmx:wsAfterMessage', function(evt) {
39
+ const chatUI = document.getElementById('message-list');
40
+ chatUI.scrollTop = chatUI.scrollHeight;
41
+ });
42
+ </script>
43
+ {% endblock %}
@@ -0,0 +1,35 @@
1
+ {% extends 'base.html' %}
2
+
3
+ {% block content %}
4
+ <div class="container mt-3">
5
+ <h2 class="mb-4">Conversation history:</h2>
6
+ {% if conversations %}
7
+ <div class="list-group">
8
+ {% for conversation in conversations %}
9
+ <a href="/chat/{{ conversation.id }}/" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
10
+ Conversation on {{ conversation.created_at|date:"M d, Y H:i" }}
11
+ <span class="badge bg-primary rounded-pill">{{ conversation.messages.count }}</span>
12
+ </a>
13
+ {% endfor %}
14
+ </div>
15
+ {% else %}
16
+ <div class="alert alert-info" role="alert">
17
+ No conversations yet.
18
+ </div>
19
+ {% endif %}
20
+ <div class="mt-4">
21
+ {% if blueprints %}
22
+ {% with first_blueprint=blueprints|first %}
23
+ <form method="post" action="{% url first_blueprint|add:':create_chat' %}">
24
+ {% csrf_token %}
25
+ <button type="submit" class="btn btn-primary">Start New Conversation</button>
26
+ </form>
27
+ {% endwith %}
28
+ {% else %}
29
+ <div class="alert alert-warning" role="alert">
30
+ No blueprints available to start a conversation.
31
+ </div>
32
+ {% endif %}
33
+ </div>
34
+ </div>
35
+ {% endblock %}
@@ -0,0 +1,55 @@
1
+ {% load static %}
2
+ <div class="side-panes chat-history-pane" id="chatHistoryPane">
3
+
4
+ <!-- Chat History Header -->
5
+ <div class="chat-history-header">
6
+ <div>
7
+ <!-- Toggle Chat History Button -->
8
+ <button class="input-button chat-history-button" id="chatHistoryToggleButton" aria-label="Toggle Chat History">
9
+ <img src="{% static 'contrib/tabler-icons/layout-sidebar-left-collapse.svg' %}" alt="Collapse Chat History Pane">
10
+ </button>
11
+
12
+ <button class="input-button upload-button" id="settingsToggleButton" aria-label="Toggle Settings">
13
+ <img src="{% static 'contrib/tabler-icons/settings.svg' %}" alt="Settings">
14
+ </button>
15
+
16
+ <!-- Search Button -->
17
+ <button class="input-button search-button" title="Search" aria-label="Search Chats">
18
+ <img src="{% static 'contrib/tabler-icons/search.svg' %}" alt="Search">
19
+ </button>
20
+
21
+ <!-- New Chat Button -->
22
+ <button class="input-button new-chat-button" title="New Chat" aria-label="Start New Chat" onclick="window.location.href='{% url 'create_chat' %}'">
23
+ <img src="{% static 'contrib/tabler-icons/message-chatbot.svg' %}" alt="New Chat">
24
+ New Chat
25
+ </button>
26
+ </div>
27
+ </div>
28
+
29
+ <!-- Chat History Items -->
30
+ <ul class="chat-history-list">
31
+ {% for conversation in conversations %}
32
+ <li class="chat-history-item">
33
+ <details>
34
+ <summary>Chat #{{ conversation.conversation_id|slice:":8" }}</summary>
35
+ <p>{{ conversation.messages.first.content|default:"No messages yet" }}</p>
36
+ <span class="chat-item-time">{{ conversation.created_at|date:"F j, Y, g:i A" }}</span>
37
+ <div class="chat-item-tools">
38
+ <!-- Tag Buttons and Delete Button -->
39
+ <div class="chat-item-tags">
40
+ <button class="tag-button" aria-label="Filter by Chat">Chat</button>
41
+ <button class="tag-button add-tag-btn" aria-label="Add Tag">+</button>
42
+ <!-- Delete Button -->
43
+ <button class="toolbar-btn delete-chat-btn" title="Delete Chat" aria-label="Delete Chat" onclick="if(confirm('Delete this chat?')){window.location.href='{% url 'delete_chat' conversation.conversation_id %}'};">
44
+ <img src="{% static 'rest_mode/svg/trash.svg' %}" alt="Delete Chat">
45
+ </button>
46
+ </div>
47
+ </div>
48
+ </details>
49
+ </li>
50
+ {% empty %}
51
+ <li class="chat-history-item">No previous chats</li>
52
+ {% endfor %}
53
+ </ul>
54
+
55
+ </div>