@page "/chat"
@page "/chat/{InitialSessionId}"
@rendermode InteractiveServer
@inject IChatSessionService ChatSessionService
@inject NavigationManager NavigationManager
@inject IJSRuntime JSRuntime
@using Alchegos.HCI.Models
@using Alchegos.HCI.Services
@implements IAsyncDisposable
Loading session...
} else if (currentSession != null) {Waiting for response...
}Enter a Session ID and click "Load / Start Session" or generate a new one.
} @code { [Parameter] public string? InitialSessionId { get; set; } private string currentSessionIdInput { get; set; } = string.Empty; private string activeSessionId { get; set; } = string.Empty; private ChatSession? currentSession; private string newMessage { get; set; } = string.Empty; private bool isLoading = false; private bool sessionLoadAttempted = false; private string externalWebhookUrl { get; set; } = string.Empty; private const string WebhookUrlStorageKey = "chatPage_externalWebhookUrl"; private bool _hasLoadedFromLocalStorage = false; private string? _previousSessionId = null; protected override void OnInitialized() { if (!string.IsNullOrEmpty(InitialSessionId)) currentSessionIdInput = InitialSessionId; } /*protected override async Task OnInitializedAsync() { Console.WriteLine("--- OnInitializedAsync START ---"); externalWebhookUrl = await JSRuntime.InvokeAsync