You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

389 lines
25KB

  1. @page "/chatroom_base/{typellm:int}"
  2. @page "/chatroom_base/{typellm:int}/{conversationid}"
  3. <script>
  4. window.autoResizeTextarea = function (elementId) {
  5. const element = document.getElementById(elementId);
  6. if (!element) return;
  7. element.style.height = 'auto';
  8. element.style.height = Math.min(element.scrollHeight, 200) + 'px';
  9. };
  10. window.setupTextareaAutoResize = function (textareaId) {
  11. const textarea = document.getElementById(textareaId);
  12. if (!textarea) return;
  13. textarea.addEventListener('input', function () {
  14. window.autoResizeTextarea(this);
  15. });
  16. // Initial resize
  17. window.autoResizeTextarea(textarea);
  18. };
  19. </script>
  20. @if (TypeLLM == 0)
  21. {
  22. <!-- Vue Home -->
  23. <div class="home-container">
  24. <div class="home-content">
  25. <!-- Section bienvenue -->
  26. <div class="welcome-section">
  27. <h1 class="welcome-title">Bonjour !</h1>
  28. <p class="welcome-subtitle">Qu'est-ce qu'on fait aujourd'hui ?</p>
  29. </div>
  30. <!-- Zone de saisie -->
  31. <div class="input-container">
  32. @if (UploadedDocuments.Any())
  33. {
  34. <div class="input-files">
  35. @foreach (var doc in UploadedDocuments)
  36. {
  37. <div class="file-item">
  38. <div class="file-preview">
  39. <div class="file-icon">
  40. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  41. <path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z" />
  42. </svg>
  43. </div>
  44. </div>
  45. <div class="file-info">
  46. <span class="file-name">@doc.FileName</span>
  47. <span class="file-size">@FormatFileSize(doc.Bytes.Length)</span>
  48. </div>
  49. <button class="remove-file-button" @onclick="() => RemoveDocument(doc)" aria-label="Supprimer le fichier">
  50. <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
  51. <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z" />
  52. </svg>
  53. </button>
  54. </div>
  55. }
  56. </div>
  57. }
  58. <div class="input-wrapper @(UploadedDocuments.Any() ? "has-files" : "")">
  59. <textarea id="homeTextarea"
  60. @bind="CurrentInput"
  61. @oninput="OnHomeTextareaInput"
  62. placeholder="Nouvelle conversation..."
  63. rows="1"
  64. disabled="@isDisabled"></textarea>
  65. <div class="input-actions">
  66. <label class="attach-button" for="fileInputHome">
  67. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
  68. <path d="M4.5 3a2.5 2.5 0 0 1 5 0v9a1.5 1.5 0 0 1-3 0V5a.5.5 0 0 1 1 0v7a.5.5 0 0 0 1 0V3a1.5 1.5 0 1 0-3 0v9a2.5 2.5 0 0 0 5 0V5a.5.5 0 0 1 1 0v7a3.5 3.5 0 1 1-7 0z" />
  69. </svg>
  70. <span>Importer un fichier</span>
  71. <InputFile id="fileInputHome" OnChange="HandleFileSelection" multiple style="display: none;" />
  72. </label>
  73. <div class="input-right-actions">
  74. @if (!hiddenDomain && SelectedAgentType == 2 && RagDomains.Any())
  75. {
  76. <select class="domain-select" @bind="SelectedDomain">
  77. @foreach (var domain in RagDomains)
  78. {
  79. <option value="@domain">@domain</option>
  80. }
  81. </select>
  82. }
  83. <button class="voice-button" @onclick="RecordVoice" aria-label="Message vocal">
  84. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
  85. <path fill-rule="evenodd" d="M8.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-1 0v-11a.5.5 0 0 1 .5-.5m-2 2a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m4 0a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m-6 1.5A.5.5 0 0 1 5 6v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m8 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m-10 1A.5.5 0 0 1 3 7v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5m12 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5" />
  86. </svg>
  87. </button>
  88. <button class="send-button"
  89. @onclick="SendMessageFromHome"
  90. disabled="@((string.IsNullOrWhiteSpace(CurrentInput) && !UploadedDocuments.Any()) || isDisabled)"
  91. aria-label="Envoyer le message">
  92. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
  93. <path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5" />
  94. </svg>
  95. </button>
  96. </div>
  97. </div>
  98. </div>
  99. <!-- Cartes des agents -->
  100. <div class="agents-grid">
  101. <label class="agent-card @(SelectedAgentType == 1 ? "selected" : "")" for="agent1">
  102. <input type="radio"
  103. id="agent1"
  104. name="agentType"
  105. value="1"
  106. checked="@(SelectedAgentType == 1)"
  107. @onchange="() => SelectAgent(1)" />
  108. <div class="agent-icon">
  109. <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
  110. <path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325" />
  111. </svg>
  112. </div>
  113. <div class="agent-content">
  114. <h3 class="agent-name">conversation</h3>
  115. <p class="agent-description">
  116. Discutez avec un agent IA ayant une bonne connaissance de votre secteur d'activité
  117. </p>
  118. </div>
  119. <div class="agent-check">
  120. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  121. <path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/>
  122. </svg>
  123. </div>
  124. </label>
  125. <label class="agent-card @(SelectedAgentType == 2 ? "selected" : "")" for="agent2">
  126. <input type="radio"
  127. id="agent2"
  128. name="agentType"
  129. value="2"
  130. checked="@(SelectedAgentType == 2)"
  131. @onchange="() => SelectAgent(2)" />
  132. <div class="agent-icon">
  133. <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
  134. <path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5M3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0m0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0m0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0" />
  135. </svg>
  136. </div>
  137. <div class="agent-content">
  138. <h3 class="agent-name">Agent RAG</h3>
  139. <p class="agent-description">
  140. un agent possédant une excellente connaissance de votre base documentaire
  141. </p>
  142. </div>
  143. <div class="agent-check">
  144. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  145. <path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/>
  146. </svg>
  147. </div>
  148. </label>
  149. <label class="agent-card @(SelectedAgentType == 3 ? "selected" : "")" for="agent3">
  150. <input type="radio"
  151. id="agent3"
  152. name="agentType"
  153. value="3"
  154. checked="@(SelectedAgentType == 3)"
  155. @onchange="() => SelectAgent(3)" />
  156. <div class="agent-icon">
  157. <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
  158. <path fill-rule="evenodd" d="M10.854 6.146a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7.5 8.793l2.646-2.647a.5.5 0 0 1 .708 0" />
  159. <path d="M3 0h10a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-1h1v1a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v1H1V2a2 2 0 0 1 2-2" />
  160. <path d="M1 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1z" />
  161. </svg>
  162. </div>
  163. <div class="agent-content">
  164. <h3 class="agent-name">L'agent Audit</h3>
  165. <p class="agent-description">
  166. Un agent IA spécialisé dans l'étude de vos documents et dans la réalisation d'audit financier
  167. </p>
  168. </div>
  169. <div class="agent-check">
  170. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  171. <path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/>
  172. </svg>
  173. </div>
  174. </label>
  175. <label class="agent-card @(SelectedAgentType == 4 ? "selected" : "")" for="agent4">
  176. <input type="radio"
  177. id="agent4"
  178. name="agentType"
  179. value="4"
  180. checked="@(SelectedAgentType == 4)"
  181. @onchange="() => SelectAgent(4)" />
  182. <div class="agent-icon">
  183. <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
  184. <path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414zM0 4.697v7.104l5.803-3.558zM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586zm3.436-.586L16 11.801V4.697z" />
  185. </svg>
  186. </div>
  187. <div class="agent-content">
  188. <h3 class="agent-name">L'agent mail spécialisé</h3>
  189. <p class="agent-description">
  190. un agent IA spécialisé dans le traitement de vos mails avec une approche humaine et experte
  191. </p>
  192. </div>
  193. <div class="agent-check">
  194. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  195. <path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/>
  196. </svg>
  197. </div>
  198. </label>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. }
  204. else
  205. {
  206. <!-- Vue ChatRoom -->
  207. <div class="chatroom-container">
  208. <!-- Zone de messages -->
  209. <div class="chatroom-messages">
  210. @if (SelectedConversation == null || !Messages.Any())
  211. {
  212. <div class="chatroom-empty">
  213. <div class="empty-icon">💬</div>
  214. <h3>Commencez une conversation</h3>
  215. <p>Posez une question ou envoyez un message pour démarrer</p>
  216. </div>
  217. }
  218. else
  219. {
  220. @foreach (var msg in Messages)
  221. {
  222. <div class="message-row @(msg.IsUser ? "user" : "assistant")">
  223. <div class="avatar @(msg.IsUser ? "avatar-user" : "avatar-assistant")">
  224. @if (msg.IsUser)
  225. {
  226. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  227. <path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0" />
  228. <path fill-rule="evenodd" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8m8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1" />
  229. </svg>
  230. }
  231. else
  232. {
  233. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  234. <path d="M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.6 26.6 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.93.93 0 0 1-.765.935c-.845.147-2.34.346-4.235.346s-3.39-.2-4.235-.346A.93.93 0 0 1 3 9.219zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a25 25 0 0 1-1.871-.183.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25 25 0 0 0 1.922-.188.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785-.842-1.7a.25.25 0 0 0-.182-.135" />
  235. <path d="M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2zM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5" />
  236. </svg>
  237. }
  238. </div>
  239. <div class="message-content-wrapper">
  240. <div class="bubble @(msg.IsUser ? "bubble-user" : "bubble-assistant")">
  241. @msg.Text
  242. </div>
  243. @if (!msg.IsUser)
  244. {
  245. <div class="message-actions">
  246. <button class="btn-message-action" @onclick="() => CopyMessage(msg.Text)" title="Copier">
  247. <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
  248. <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1z" />
  249. <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0z" />
  250. </svg>
  251. </button>
  252. </div>
  253. }
  254. </div>
  255. </div>
  256. }
  257. @if (isTyping)
  258. {
  259. <div class="message-row assistant">
  260. <div class="avatar avatar-assistant">
  261. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  262. <path d="M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.6 26.6 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.93.93 0 0 1-.765.935c-.845.147-2.34.346-4.235.346s-3.39-.2-4.235-.346A.93.93 0 0 1 3 9.219zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a25 25 0 0 1-1.871-.183.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25 25 0 0 0 1.922-.188.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785-.842-1.7a.25.25 0 0 0-.182-.135" />
  263. <path d="M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2zM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5" />
  264. </svg>
  265. </div>
  266. <div class="message-content-wrapper">
  267. <div class="bubble bubble-assistant">
  268. <div class="typing-indicator">
  269. <span></span>
  270. <span></span>
  271. <span></span>
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. }
  277. }
  278. </div>
  279. <!-- Zone de saisie moderne -->
  280. <div class="chat-input-container">
  281. <!-- Fichiers attachés -->
  282. @if (UploadedDocuments.Any())
  283. {
  284. <div class="attached-files">
  285. @foreach (var doc in UploadedDocuments)
  286. {
  287. <div class="file-item">
  288. <div class="file-preview">
  289. <div class="file-icon">
  290. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
  291. <path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z" />
  292. </svg>
  293. </div>
  294. </div>
  295. <div class="file-info">
  296. <span class="file-name">@doc.FileName</span>
  297. <span class="file-size">@FormatFileSize(doc.Bytes.Length)</span>
  298. </div>
  299. <button class="remove-file-button" @onclick="() => RemoveDocument(doc)" aria-label="Supprimer le fichier">
  300. <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
  301. <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z" />
  302. </svg>
  303. </button>
  304. </div>
  305. }
  306. </div>
  307. }
  308. <!-- Input wrapper -->
  309. <div class="input-wrapper @(UploadedDocuments.Any() ? "has-files" : "")">
  310. <textarea id="chatroomTextarea"
  311. @bind="CurrentInput"
  312. @oninput="OnChatroomTextareaInput"
  313. @onkeydown="HandleKeyPress"
  314. placeholder="Nouvelle conversation..."
  315. rows="1"></textarea>
  316. <div class="actions-row">
  317. <!-- Bouton attachement -->
  318. <label class="attach-button" for="fileUpload">
  319. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
  320. <path d="M4.5 3a2.5 2.5 0 0 1 5 0v9a1.5 1.5 0 0 1-3 0V5a.5.5 0 0 1 1 0v7a.5.5 0 0 0 1 0V3a1.5 1.5 0 1 0-3 0v9a2.5 2.5 0 0 0 5 0V5a.5.5 0 0 1 1 0v7a3.5 3.5 0 1 1-7 0z" />
  321. </svg>
  322. <span>Importer un fichier</span>
  323. <InputFile id="fileUpload" OnChange="UploadDocuments" multiple style="display: none;" />
  324. </label>
  325. <div class="right-actions">
  326. <!-- Sélecteur de domaine RAG -->
  327. @if (!hiddenDomain && RagDomains.Any())
  328. {
  329. <select class="domain-select" @bind="SelectedDomain">
  330. @foreach (var domain in RagDomains)
  331. {
  332. <option value="@domain">@domain</option>
  333. }
  334. </select>
  335. }
  336. <!-- Bouton historique -->
  337. <button class="history-button @(IsWithHistorique ? "active" : "desactive")" @onclick="ToggleHistory" title="@(IsWithHistorique ? "Historique activé" : "Historique désactivé")">
  338. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 16 16">
  339. <path d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022zm2.004.45a7 7 0 0 0-.985-.299l.219-.976q.576.129 1.126.342zm1.37.71a7 7 0 0 0-.439-.27l.493-.87a8 8 0 0 1 .979.654l-.615.789a7 7 0 0 0-.418-.302zm1.834 1.79a7 7 0 0 0-.653-.796l.724-.69q.406.429.747.91zm.744 1.352a7 7 0 0 0-.214-.468l.893-.45a8 8 0 0 1 .45 1.088l-.95.313a7 7 0 0 0-.179-.483m.53 2.507a7 7 0 0 0-.1-1.025l.985-.17q.1.58.116 1.17zm-.131 1.538q.05-.254.081-.51l.993.123a8 8 0 0 1-.23 1.155l-.964-.267q.069-.247.12-.501m-.952 2.379q.276-.436.486-.908l.914.405q-.24.54-.555 1.038zm-.964 1.205q.183-.183.35-.378l.758.653a8 8 0 0 1-.401.432z" />
  340. <path d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0z" />
  341. <path d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5" />
  342. </svg>
  343. </button>
  344. <button class="voice-button" @onclick="RecordVoice" aria-label="Message vocal">
  345. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
  346. <path fill-rule="evenodd" d="M8.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-1 0v-11a.5.5 0 0 1 .5-.5m-2 2a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m4 0a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m-6 1.5A.5.5 0 0 1 5 6v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m8 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m-10 1A.5.5 0 0 1 3 7v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5m12 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5" />
  347. </svg>
  348. </button>
  349. <!-- Bouton envoyer -->
  350. <button class="send-button"
  351. @onclick="SendMessage"
  352. disabled="@(string.IsNullOrWhiteSpace(CurrentInput) && !UploadedDocuments.Any())"
  353. aria-label="Envoyer le message">
  354. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
  355. <path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5" />
  356. </svg>
  357. </button>
  358. </div>
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. }