Add agent system with Core and Librarian agent implementations

Define IAgent interface and implement CoreAgent (main conversational
agent) and LibrarianAgent (knowledge retrieval agent). Includes DI
service collection extensions for agent registration.
This commit is contained in:
2026-04-04 04:10:51 +02:00
parent 1c42c8c006
commit 29eb3851c9
6 changed files with 206 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
using Luna.Configuration;
using Microsoft.Extensions.AI;
namespace Luna.Agents.Abstractions;
public interface IAgent
{
public static virtual string Name { get; } = null!;
public string DisplayName { get; }
public string Description { get; }
public AgentOptions Options { get; init; }
Task<IEnumerable<ChatMessage>> ProcessAsync(IReadOnlyList<ChatMessage> messages,
CancellationToken ct = default);
IAsyncEnumerable<ChatResponseUpdate> ProcessStreamingAsync(IReadOnlyList<ChatMessage> messages,
CancellationToken ct = default);
}
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="10.4.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Luna.Configuration\Luna.Configuration.csproj" />
<ProjectReference Include="..\Luna.Shared\Luna.Shared.csproj" />
</ItemGroup>
</Project>