| | | 1 | | using System.ComponentModel; |
| | | 2 | | using Spectre.Console; |
| | | 3 | | using Spectre.Console.Cli; |
| | | 4 | | |
| | | 5 | | namespace Orchestrator.Commands.Observability.ReconstructPrompt; |
| | | 6 | | |
| | | 7 | | public class ReconstructPromptSettings : CommandSettings |
| | | 8 | | { |
| | | 9 | | [CommandArgument(0, "<MODEL>")] |
| | | 10 | | [Description("The model used for the stored prediction")] |
| | 1 | 11 | | public string Model { get; set; } = string.Empty; |
| | | 12 | | |
| | | 13 | | [CommandOption("--community-context")] |
| | | 14 | | [Description("Community context used for the stored prediction")] |
| | 1 | 15 | | public string CommunityContext { get; set; } = string.Empty; |
| | | 16 | | |
| | | 17 | | [CommandOption("--home")] |
| | | 18 | | [Description("Home team name")] |
| | 1 | 19 | | public string HomeTeam { get; set; } = string.Empty; |
| | | 20 | | |
| | | 21 | | [CommandOption("--away")] |
| | | 22 | | [Description("Away team name")] |
| | 1 | 23 | | public string AwayTeam { get; set; } = string.Empty; |
| | | 24 | | |
| | | 25 | | [CommandOption("--matchday")] |
| | | 26 | | [Description("Matchday number for the selected match")] |
| | 1 | 27 | | public int? Matchday { get; set; } |
| | | 28 | | |
| | | 29 | | [CommandOption("--with-justification")] |
| | | 30 | | [Description("Reconstruct the justification prompt variant")] |
| | | 31 | | [DefaultValue(false)] |
| | 1 | 32 | | public bool WithJustification { get; set; } |
| | | 33 | | |
| | | 34 | | [CommandOption("--evaluation-time")] |
| | | 35 | | [Description("Optional explicit evaluation time in NodaTime invariant ZonedDateTime 'G' format, for example '2026-03 |
| | 1 | 36 | | public string? EvaluationTime { get; set; } |
| | | 37 | | |
| | | 38 | | public override ValidationResult Validate() |
| | | 39 | | { |
| | 1 | 40 | | if (string.IsNullOrWhiteSpace(Model)) |
| | | 41 | | { |
| | 0 | 42 | | return ValidationResult.Error("Model is required"); |
| | | 43 | | } |
| | | 44 | | |
| | 1 | 45 | | if (string.IsNullOrWhiteSpace(CommunityContext)) |
| | | 46 | | { |
| | 0 | 47 | | return ValidationResult.Error("--community-context is required"); |
| | | 48 | | } |
| | | 49 | | |
| | 1 | 50 | | if (string.IsNullOrWhiteSpace(HomeTeam)) |
| | | 51 | | { |
| | 0 | 52 | | return ValidationResult.Error("--home must be provided"); |
| | | 53 | | } |
| | | 54 | | |
| | 1 | 55 | | if (string.IsNullOrWhiteSpace(AwayTeam)) |
| | | 56 | | { |
| | 0 | 57 | | return ValidationResult.Error("--away must be provided"); |
| | | 58 | | } |
| | | 59 | | |
| | 1 | 60 | | if (!Matchday.HasValue) |
| | | 61 | | { |
| | 0 | 62 | | return ValidationResult.Error("--matchday must be provided"); |
| | | 63 | | } |
| | | 64 | | |
| | 1 | 65 | | if (!string.IsNullOrWhiteSpace(EvaluationTime)) |
| | | 66 | | { |
| | | 67 | | try |
| | | 68 | | { |
| | 1 | 69 | | _ = Commands.Observability.EvaluationTimeParser.Parse(EvaluationTime); |
| | 1 | 70 | | } |
| | | 71 | | catch (ArgumentException ex) |
| | | 72 | | { |
| | 0 | 73 | | return ValidationResult.Error(ex.Message); |
| | | 74 | | } |
| | | 75 | | } |
| | | 76 | | |
| | 1 | 77 | | return ValidationResult.Success(); |
| | 0 | 78 | | } |
| | | 79 | | } |