V18 / 8d896b8a86e5
Lilith.Personality.cs
Lilith/Agent/Lilith.Personality.cs
Unchanged from the preceding versionCS
using Lilith.Core.Commands;
using Lilith.Core.Personality;
namespace Lilith.Agent;
public partial class Lilith
{
public string? PersonalityFile { get; set; }
public PersonalityProfile Personality => Client.Personality!.Current;
partial void RegisterPersonalityCommands(ChatCommandRegistry commands) => PersonalityCommands.Register(commands, () => Client);
private async Task SpeakReplyAsync(string reply, CancellationToken ct = default)
{
if (_tts is null) return;
if (Client.Personality is { } profile && _tts.VoiceId != profile.Current.Voice)
await _tts.SetVoiceAsync(profile.Current.Voice, ct);
await _tts.SpeakAsync(reply, ct);
}
}