Browse Source

gestion du llm audit

WebUI
maela 2 days ago
parent
commit
b468cb4bad
2 changed files with 147 additions and 104 deletions
  1. +116
    -97
      WebUI/ReAct_PME.WebUI/Pages/ChatRoom/ChatRoom_base.razor
  2. +31
    -7
      WebUI/ReAct_PME.WebUI/Pages/ChatRoom/ChatRoom_base.razor.cs

+ 116
- 97
WebUI/ReAct_PME.WebUI/Pages/ChatRoom/ChatRoom_base.razor View File

</label> </label>


<div class="input-right-actions"> <div class="input-right-actions">
@* Sélecteur de domaine pour RAG *@
@if (!hiddenDomain && SelectedAgentType == 2 && RagDomains.Any()) @if (!hiddenDomain && SelectedAgentType == 2 && RagDomains.Any())
{ {
<select class="domain-select" @bind="SelectedDomain"> <select class="domain-select" @bind="SelectedDomain">
} }
</select> </select>
} }

@* Input ID Client pour AUDIT *@
@if (SelectedAgentType == 3)
{
<input type="text"
class="client-id-input"
@bind="ClientId"
placeholder="ID Client"
aria-label="ID Client" />
}

<button class="voice-button" @onclick="RecordVoice" aria-label="Message vocal"> <button class="voice-button" @onclick="RecordVoice" aria-label="Message vocal">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<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" /> <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" />


<button class="send-button" <button class="send-button"
@onclick="SendMessageFromHome" @onclick="SendMessageFromHome"
disabled="@((string.IsNullOrWhiteSpace(CurrentInput) && !UploadedDocuments.Any()) || isDisabled)"
disabled="@((string.IsNullOrWhiteSpace(CurrentInput) && !UploadedDocuments.Any()) || isDisabled || (SelectedAgentType == 3 && string.IsNullOrWhiteSpace(ClientId)))"
aria-label="Envoyer le message"> aria-label="Envoyer le message">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<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" /> <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" />
</div> </div>


<!-- Cartes des agents --> <!-- Cartes des agents -->
<div class="agents-grid">
<label class="agent-card @(SelectedAgentType == 1 ? "selected" : "")" for="agent1">
<input type="radio"
id="agent1"
name="agentType"
value="1"
checked="@(SelectedAgentType == 1)"
@onchange="() => SelectAgent(1)" />
<div class="agent-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
<div class="agent-content">
<h3 class="agent-name">conversation</h3>
<p class="agent-description">
<div class="agents-grid">
<label class="agent-card @(SelectedAgentType == 1 ? "selected" : "")" for="agent1">
<input type="radio"
id="agent1"
name="agentType"
value="1"
checked="@(SelectedAgentType == 1)"
@onchange="() => SelectAgent(1)" />
<div class="agent-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
<div class="agent-content">
<h3 class="agent-name">conversation</h3>
<p class="agent-description">
Discutez avec un agent IA ayant une bonne connaissance de votre secteur d'activité Discutez avec un agent IA ayant une bonne connaissance de votre secteur d'activité
</p>
</div>
<div class="agent-check">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<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"/>
</svg>
</div>
</label>
</p>
</div>
<div class="agent-check">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
</label>


<label class="agent-card @(SelectedAgentType == 2 ? "selected" : "")" for="agent2">
<input type="radio"
id="agent2"
name="agentType"
value="2"
checked="@(SelectedAgentType == 2)"
@onchange="() => SelectAgent(2)" />
<div class="agent-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
<div class="agent-content">
<h3 class="agent-name">Agent RAG</h3>
<p class="agent-description">
<label class="agent-card @(SelectedAgentType == 2 ? "selected" : "")" for="agent2">
<input type="radio"
id="agent2"
name="agentType"
value="2"
checked="@(SelectedAgentType == 2)"
@onchange="() => SelectAgent(2)" />
<div class="agent-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
<div class="agent-content">
<h3 class="agent-name">Agent RAG</h3>
<p class="agent-description">
un agent possédant une excellente connaissance de votre base documentaire un agent possédant une excellente connaissance de votre base documentaire
</p> </p>
</div>
<div class="agent-check">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<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"/>
</svg>
</div>
</label>
</div>
<div class="agent-check">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
</label>


<label class="agent-card @(SelectedAgentType == 3 ? "selected" : "")" for="agent3">
<input type="radio"
id="agent3"
name="agentType"
value="3"
checked="@(SelectedAgentType == 3)"
@onchange="() => SelectAgent(3)" />
<div class="agent-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
<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" />
<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" />
<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" />
</svg>
</div>
<div class="agent-content">
<label class="agent-card @(SelectedAgentType == 3 ? "selected" : "")" for="agent3">
<input type="radio"
id="agent3"
name="agentType"
value="3"
checked="@(SelectedAgentType == 3)"
@onchange="() => SelectAgent(3)" />
<div class="agent-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
<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" />
<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" />
<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" />
</svg>
</div>
<div class="agent-content">
<h3 class="agent-name">L'agent Audit</h3> <h3 class="agent-name">L'agent Audit</h3>
<p class="agent-description"> <p class="agent-description">
Un agent IA spécialisé dans l'étude de vos documents et dans la réalisation d'audit financier Un agent IA spécialisé dans l'étude de vos documents et dans la réalisation d'audit financier
</p> </p>
</div>
<div class="agent-check">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<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"/>
</svg>
</div>
</label>
</div>
<div class="agent-check">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
</label>


<label class="agent-card @(SelectedAgentType == 4 ? "selected" : "")" for="agent4">
<input type="radio"
id="agent4"
name="agentType"
value="4"
checked="@(SelectedAgentType == 4)"
@onchange="() => SelectAgent(4)" />
<div class="agent-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
<div class="agent-content">
<label class="agent-card @(SelectedAgentType == 4 ? "selected" : "")" for="agent4">
<input type="radio"
id="agent4"
name="agentType"
value="4"
checked="@(SelectedAgentType == 4)"
@onchange="() => SelectAgent(4)" />
<div class="agent-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
<div class="agent-content">
<h3 class="agent-name">L'agent mail spécialisé</h3> <h3 class="agent-name">L'agent mail spécialisé</h3>
<p class="agent-description"> <p class="agent-description">
un agent IA spécialisé dans le traitement de vos mails avec une approche humaine et experte un agent IA spécialisé dans le traitement de vos mails avec une approche humaine et experte
</p> </p>
</div>
<div class="agent-check">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<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"/>
</svg>
</div>
</label>
</div>
<div class="agent-check">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<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" />
</svg>
</div>
</label>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>


} }
else else
<div class="chatroom-empty"> <div class="chatroom-empty">
<div class="empty-icon">💬</div> <div class="empty-icon">💬</div>
<h3>Commencez une conversation</h3> <h3>Commencez une conversation</h3>
<p>Posez une question ou envoyez un message pour démarrer</p>
<p>Tapez votre premier message ci-dessous</p>
</div> </div>
} }
else else
@if (msg.IsUser) @if (msg.IsUser)
{ {
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0" />
<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" />
<path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z" />
</svg> </svg>
} }
else else
</svg> </svg>
} }
</div> </div>

<div class="message-content-wrapper"> <div class="message-content-wrapper">
<div class="bubble @(msg.IsUser ? "bubble-user" : "bubble-assistant")"> <div class="bubble @(msg.IsUser ? "bubble-user" : "bubble-assistant")">
@msg.Text @msg.Text
</div> </div>

@if (!msg.IsUser) @if (!msg.IsUser)
{ {
<div class="message-actions"> <div class="message-actions">
<button class="btn-message-action" @onclick="() => CopyMessage(msg.Text)" title="Copier"> <button class="btn-message-action" @onclick="() => CopyMessage(msg.Text)" title="Copier">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<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" /> <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" />
<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" /> <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" />
</svg> </svg>
</select> </select>
} }


@* Input ID Client pour AUDIT *@
@if (TypeLLM == 3)
{
<input type="text"
class="client-id-input"
@bind="ClientId"
placeholder="ID Client"
aria-label="ID Client" />
}

<!-- Bouton historique --> <!-- Bouton historique -->
<button class="history-button @(IsWithHistorique ? "active" : "desactive")" @onclick="ToggleHistory" title="@(IsWithHistorique ? "Historique activé" : "Historique désactivé")"> <button class="history-button @(IsWithHistorique ? "active" : "desactive")" @onclick="ToggleHistory" title="@(IsWithHistorique ? "Historique activé" : "Historique désactivé")">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 16 16">
<!-- Bouton envoyer --> <!-- Bouton envoyer -->
<button class="send-button" <button class="send-button"
@onclick="SendMessage" @onclick="SendMessage"
disabled="@(string.IsNullOrWhiteSpace(CurrentInput) && !UploadedDocuments.Any())"
disabled="@((string.IsNullOrWhiteSpace(CurrentInput) && !UploadedDocuments.Any()) || (TypeLLM == 3 && string.IsNullOrWhiteSpace(ClientId)))"
aria-label="Envoyer le message"> aria-label="Envoyer le message">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<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" /> <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" />

+ 31
- 7
WebUI/ReAct_PME.WebUI/Pages/ChatRoom/ChatRoom_base.razor.cs View File



public string CurrentInput { get; set; } = ""; public string CurrentInput { get; set; } = "";
public int SelectedAgentType { get; set; } = 1; // Agent par défaut sélectionné public int SelectedAgentType { get; set; } = 1; // Agent par défaut sélectionné
public string ClientId { get; set; } = ""; // ID Client pour AUDIT


// Options // Options
public List<string> RagDomains { get; set; } = new(); public List<string> RagDomains { get; set; } = new();
{ {
SelectedMode = "llm"; SelectedMode = "llm";
IsWithHistorique = true; IsWithHistorique = true;
hiddenDomain = true;
hiddenDomain = true;
} }
else if (TypeLLM == 2) else if (TypeLLM == 2)
{ {
SelectedMode = "rag"; SelectedMode = "rag";
IsWithHistorique = false; IsWithHistorique = false;
hiddenDomain = false;
hiddenDomain = false;
await LoadRagDomains(); await LoadRagDomains();
if (RagDomains.Any()) if (RagDomains.Any())
SelectedDomain = RagDomains[0]; SelectedDomain = RagDomains[0];
} }
else if (TypeLLM == 3) else if (TypeLLM == 3)
{ {
SelectedMode = "code";
IsWithHistorique = true;
hiddenDomain = true;
SelectedMode = "audit";
IsWithHistorique = false;
hiddenDomain = true;
SelectedDomain = "comptabilite"; // Domaine fixe pour AUDIT
} }
else if (TypeLLM == 4) else if (TypeLLM == 4)
{ {
SelectedMode = "image"; SelectedMode = "image";
IsWithHistorique = false; IsWithHistorique = false;
hiddenDomain = true;
hiddenDomain = true;
} }
else else
{ {
SelectedMode = "llm"; SelectedMode = "llm";
IsWithHistorique = true; IsWithHistorique = true;
hiddenDomain = true;
hiddenDomain = true;
} }


if (!string.IsNullOrEmpty(ConversationId)) if (!string.IsNullOrEmpty(ConversationId))
if (string.IsNullOrWhiteSpace(CurrentInput) && !UploadedDocuments.Any()) if (string.IsNullOrWhiteSpace(CurrentInput) && !UploadedDocuments.Any())
return; return;


// Vérification de l'ID Client pour AUDIT
if (SelectedAgentType == 3 && string.IsNullOrWhiteSpace(ClientId))
{
ToastService.ShowWarning("Veuillez saisir l'ID Client pour l'audit");
return;
}

try try
{ {
isDisabled = true; isDisabled = true;
await LoadRagDomains(); await LoadRagDomains();
domain = !string.IsNullOrEmpty(SelectedDomain) ? SelectedDomain : (RagDomains.Any() ? RagDomains[0] : ""); domain = !string.IsNullOrEmpty(SelectedDomain) ? SelectedDomain : (RagDomains.Any() ? RagDomains[0] : "");
} }
else if (SelectedAgentType == 3)
{
domain = "comptabilite"; // Domaine fixe pour AUDIT
}


var payload = new SendMessageRequest var payload = new SendMessageRequest
{ {
} }
} }


// Vérification de l'ID Client pour AUDIT
if (TypeLLM == 3 && string.IsNullOrWhiteSpace(ClientId))
{
ToastService.ShowWarning("Veuillez saisir l'ID Client pour l'audit");
return;
}

isTyping = true; isTyping = true;
StateHasChanged(); StateHasChanged();


if (RagDomains.Any()) if (RagDomains.Any())
SelectedDomain = RagDomains[0]; SelectedDomain = RagDomains[0];
} }
else if (agentId == 3)
{
SelectedDomain = "compta"; // Domaine fixe pour AUDIT
}


StateHasChanged(); StateHasChanged();
} }

Loading…
Cancel
Save