add: hci
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
<input @bind="currentSessionIdInput" placeholder="Enter or Generate Session ID" />
|
||||
<button @onclick="LoadSession" disabled="@isLoading">Load / Start Session</button>
|
||||
<button @onclick="GenerateSessionId" disabled="@isLoading">Generate New ID</button>
|
||||
<input @bind="externalWebhookUrl" placeholder="Server url">
|
||||
@if (!string.IsNullOrEmpty(activeSessionId))
|
||||
{
|
||||
<span>Active Session: @activeSessionId</span>
|
||||
@@ -62,7 +63,7 @@ else if (sessionLoadAttempted)
|
||||
private string newMessage { get; set; } = string.Empty;
|
||||
private bool isLoading = false;
|
||||
private bool sessionLoadAttempted = false;
|
||||
|
||||
private string externalWebhookUrl { get; set; } = string.Empty;
|
||||
|
||||
|
||||
private string? _previousSessionId = null;
|
||||
@@ -170,7 +171,7 @@ else if (sessionLoadAttempted)
|
||||
|
||||
private async Task SendMessage()
|
||||
{
|
||||
if (currentSession == null || string.IsNullOrWhiteSpace(newMessage) || currentSession.IsWaitingForResponse)
|
||||
if (currentSession == null || string.IsNullOrWhiteSpace(newMessage) || currentSession.IsWaitingForResponse || String.IsNullOrWhiteSpace(externalWebhookUrl))
|
||||
return;
|
||||
|
||||
var userMessage = new ChatMessage { IsUser = true, Content = newMessage };
|
||||
@@ -182,7 +183,7 @@ else if (sessionLoadAttempted)
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
await ChatSessionService.SendMessageToExternalWebhook(activeSessionId, messageToSend);
|
||||
await ChatSessionService.SendMessageToExternalWebhook(externalWebhookUrl, activeSessionId, messageToSend);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user