- AI chat with SSE streaming (Microsoft Agent Framework + Qwen) - RAG Q&A with hybrid retrieval (vector + keyword RRF fusion) - Knowledge base CRUD with semantic text chunking - Embedding generation via Azure.AI.OpenAI / LM Studio - Document upload with chunked upload support - Redis caching for chat messages - Chunk/vector preview endpoints - gRPC auth service improvements - Removed demo menus, cleaned up seed data
25 lines
741 B
C#
25 lines
741 B
C#
using FastEndpoints;
|
|
using MediatR;
|
|
using RAG.Application.Chat.Commands;
|
|
using RAG.Application.Chat.DTOs;
|
|
|
|
namespace RAG.Api.Endpoints.Chat;
|
|
|
|
public class SendMessageEndpoint(IMediator mediator) : Endpoint<SendMessageRequest, SendMessageResponse>
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Post("/chat/conversations/{ConversationId}/messages");
|
|
AllowAnonymous();
|
|
}
|
|
|
|
public override async Task HandleAsync(SendMessageRequest req, CancellationToken ct)
|
|
{
|
|
var conversationId = Route<Guid>("ConversationId");
|
|
var result = await mediator.Send(new SendMessageCommand(conversationId, req.Content), ct);
|
|
await Send.OkAsync(result, ct);
|
|
}
|
|
}
|
|
|
|
public record SendMessageRequest(string Content);
|