- 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
22 lines
696 B
C#
22 lines
696 B
C#
using FluentValidation;
|
|
|
|
namespace RAG.Application.Embedding.Validators;
|
|
|
|
public class EmbedTextCommandValidator : AbstractValidator<Commands.EmbedTextCommand>
|
|
{
|
|
public EmbedTextCommandValidator()
|
|
{
|
|
RuleFor(x => x.Text).NotEmpty().WithMessage("文本内容不能为空")
|
|
.MaximumLength(10000).WithMessage("单条文本不能超过10000个字符");
|
|
}
|
|
}
|
|
|
|
public class EmbedBatchCommandValidator : AbstractValidator<Commands.EmbedBatchCommand>
|
|
{
|
|
public EmbedBatchCommandValidator()
|
|
{
|
|
RuleFor(x => x.Texts).NotEmpty().WithMessage("文本列表不能为空")
|
|
.Must(t => t.Count <= 100).WithMessage("批量文本不能超过100条");
|
|
}
|
|
}
|