| | | 1 | | using System.ComponentModel; |
| | | 2 | | using EHonda.KicktippAi.Core; |
| | | 3 | | using Spectre.Console; |
| | | 4 | | using Spectre.Console.Cli; |
| | | 5 | | |
| | | 6 | | namespace Orchestrator.Commands.Operations.Matchday; |
| | | 7 | | |
| | | 8 | | public class BaseSettings : CommandSettings |
| | | 9 | | { |
| | | 10 | | [CommandArgument(0, "<MODEL>")] |
| | | 11 | | [Description("The OpenAI model to use for prediction")] |
| | | 12 | | public string? Model { get; set; } |
| | | 13 | | |
| | | 14 | | [CommandOption("-c|--community")] |
| | | 15 | | [Description("The Kicktipp community to use (e.g., ehonda-test-buli)")] |
| | | 16 | | public required string Community { get; set; } |
| | | 17 | | |
| | | 18 | | [CommandOption("--community-context")] |
| | | 19 | | [Description("The community context for filtering predictions (defaults to community name if not specified)")] |
| | | 20 | | public string? CommunityContext { get; set; } |
| | | 21 | | |
| | | 22 | | [CommandOption("--competition")] |
| | | 23 | | [Description("Competition identifier (defaults from community, e.g., fifa-world-cup-2026 for ehonda-dev-wm26)")] |
| | | 24 | | public string? Competition { get; set; } |
| | | 25 | | |
| | | 26 | | [CommandOption("--reasoning-effort")] |
| | | 27 | | [Description("Optional OpenAI reasoning effort (none, minimal, low, medium, high, xhigh)")] |
| | | 28 | | public string? ReasoningEffort { get; set; } |
| | | 29 | | |
| | | 30 | | [CommandOption("--max-output-tokens")] |
| | | 31 | | [Description("Optional maximum output token cap for prediction generation")] |
| | | 32 | | public int? MaxOutputTokenCount { get; set; } |
| | | 33 | | |
| | | 34 | | [CommandOption("--prompt-source")] |
| | | 35 | | [Description("Prompt source to use: local or langfuse")] |
| | | 36 | | public string? PromptSource { get; set; } |
| | | 37 | | |
| | | 38 | | [CommandOption("--langfuse-prompt-name")] |
| | | 39 | | [Description("Langfuse hosted prompt name when --prompt-source langfuse is used")] |
| | | 40 | | public string? LangfusePromptName { get; set; } |
| | | 41 | | |
| | | 42 | | [CommandOption("--langfuse-prompt-label")] |
| | | 43 | | [Description("Langfuse hosted prompt label when --prompt-source langfuse is used")] |
| | | 44 | | public string? LangfusePromptLabel { get; set; } |
| | | 45 | | |
| | | 46 | | [CommandOption("--langfuse-prompt-version")] |
| | | 47 | | [Description("Optional Langfuse hosted prompt version when --prompt-source langfuse is used")] |
| | | 48 | | public int? LangfusePromptVersion { get; set; } |
| | | 49 | | |
| | | 50 | | [CommandOption("-v|--verbose")] |
| | | 51 | | [Description("Enable verbose output to show detailed information")] |
| | | 52 | | [DefaultValue(false)] |
| | | 53 | | public bool Verbose { get; set; } |
| | | 54 | | |
| | | 55 | | [CommandOption("--override-kicktipp")] |
| | | 56 | | [Description("Override existing predictions on Kicktipp (default: false)")] |
| | | 57 | | [DefaultValue(false)] |
| | | 58 | | public bool OverrideKicktipp { get; set; } |
| | | 59 | | |
| | | 60 | | [CommandOption("--override-database")] |
| | | 61 | | [Description("Override existing predictions in the database (default: false)")] |
| | | 62 | | [DefaultValue(false)] |
| | | 63 | | public bool OverrideDatabase { get; set; } |
| | | 64 | | |
| | | 65 | | [CommandOption("--agent")] |
| | | 66 | | [Description("Agent mode - hide prediction details from output (for automated environments)")] |
| | | 67 | | [DefaultValue(false)] |
| | | 68 | | public bool Agent { get; set; } |
| | | 69 | | |
| | | 70 | | [CommandOption("--dry-run")] |
| | | 71 | | [Description("Dry run mode - no changes will be made to database or Kicktipp")] |
| | | 72 | | [DefaultValue(false)] |
| | | 73 | | public bool DryRun { get; set; } |
| | | 74 | | |
| | | 75 | | [CommandOption("--show-context-documents")] |
| | | 76 | | [Description("Show the content of context documents used for prediction")] |
| | | 77 | | [DefaultValue(false)] |
| | | 78 | | public bool ShowContextDocuments { get; set; } |
| | | 79 | | |
| | | 80 | | [CommandOption("--with-justification")] |
| | | 81 | | [Description("Include model justification text alongside predictions (non-agent mode only)")] |
| | | 82 | | [DefaultValue(false)] |
| | | 83 | | public bool WithJustification { get; set; } |
| | | 84 | | |
| | | 85 | | [CommandOption("--estimated-costs")] |
| | | 86 | | [Description("Model to estimate costs for (e.g., o1) - shows what costs would be if using that model with same token |
| | | 87 | | public string? EstimatedCostsModel { get; set; } |
| | | 88 | | |
| | | 89 | | [CommandOption("--repredict")] |
| | | 90 | | [Description("Enable reprediction mode - create new predictions with incremented reprediction index (cannot be used |
| | | 91 | | [DefaultValue(false)] |
| | | 92 | | public bool Repredict { get; set; } |
| | | 93 | | |
| | | 94 | | [CommandOption("--max-repredictions")] |
| | | 95 | | [Description("Maximum number of repredictions allowed (0-based index). Implies --repredict. Example: 2 allows repred |
| | | 96 | | public int? MaxRepredictions { get; set; } |
| | | 97 | | |
| | | 98 | | /// <summary> |
| | | 99 | | /// Gets whether reprediction mode is enabled (either explicitly via --repredict or implicitly via --max-repredictio |
| | | 100 | | /// </summary> |
| | 1 | 101 | | public bool IsRepredictMode => Repredict || MaxRepredictions.HasValue; |
| | | 102 | | |
| | | 103 | | public override ValidationResult Validate() |
| | | 104 | | { |
| | 1 | 105 | | if (string.IsNullOrWhiteSpace(Model)) |
| | | 106 | | { |
| | 0 | 107 | | return ValidationResult.Error("MODEL is required"); |
| | | 108 | | } |
| | | 109 | | |
| | 1 | 110 | | if (!PredictionModelConfig.IsValidReasoningEffort(ReasoningEffort)) |
| | | 111 | | { |
| | 0 | 112 | | return ValidationResult.Error("--reasoning-effort must be one of: none, minimal, low, medium, high, xhigh"); |
| | | 113 | | } |
| | | 114 | | |
| | 1 | 115 | | if (MaxOutputTokenCount is < 1) |
| | | 116 | | { |
| | 1 | 117 | | return ValidationResult.Error("--max-output-tokens must be at least 1 when provided"); |
| | | 118 | | } |
| | | 119 | | |
| | 1 | 120 | | return ValidationResult.Success(); |
| | | 121 | | } |
| | | 122 | | } |