Services/WebTts.cscsharp

Documentation

Lilith.RazorWebGui (Version 4)

ASP.NET Core Razor Pages web UI for Lilith Version 4. Mirrors LilithConsole chat, commands, and logging.

  • Model: LILITH_MODEL (default gemma4)
  • Commands: exit, /new, /history, /history <n>, /voice <name> (when TTS is enabled)
dotnet run --project Lilith.RazorWebGui.csproj

Browse http://localhost:5000 (see Properties/launchSettings.json).

using Agent.Core.Logging;using Agent.Core.TextToSpeech;namespace Lilith.RazorWebGui.Services;internal static class WebTts{    internal static async Task SpeakReplyAsync(KokoroTts? tts, Logger logger, string? reply)    {        if (tts is null || string.IsNullOrWhiteSpace(reply))        {            return;        }        try        {            await tts.SpeakAsync(reply).ConfigureAwait(false);        }        catch (Exception ex)        {            logger.WriteLine("TTS", $"Speech failed: {ex.Message}", LogColors.Orange);        }    }}