namespace Nalu.Web.Models;

public class ValidatorDefinition
{
    public required string Id { get; init; }
    public string Type { get; set; } = "extraction";
    public string Version { get; set; } = "1.0";
    public List<string> Languages { get; set; } = [];
    public string Endpoint { get; set; } = "";
    public string McpTool { get; set; } = "";
    public string McpDescription { get; set; } = "";
    public string Description { get; set; } = "";

    // Deterministic rules
    public HashSet<string> StopWords { get; set; } = [];
    public List<string> RejectPatterns { get; set; } = [];
    public List<string> AcceptPatterns { get; set; } = [];
    public Dictionary<string, string> Constraints { get; set; } = [];

    // LLM
    public string Prompt { get; set; } = "";
    public List<FewShotExample> FewShotExamples { get; set; } = [];

    // Processing
    public List<string> PostProcessors { get; set; } = [];
    public List<string> Enrichers { get; set; } = [];

    // Suggestions — flat (default) and localized (keyed by locale e.g. "pt-BR")
    public Dictionary<string, string> Suggestions { get; set; } = new(StringComparer.OrdinalIgnoreCase);
    public Dictionary<string, Dictionary<string, string>> LocalizedSuggestions { get; set; } = new(StringComparer.OrdinalIgnoreCase);

    // Localized stop words (keyed by locale)
    public Dictionary<string, HashSet<string>> LocalizedStopWords { get; set; } = new(StringComparer.OrdinalIgnoreCase);
}

public record FewShotExample
{
    public required string AgentInput { get; init; }
    public required string UserInput { get; init; }
    public required string Output { get; init; }
}
