| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | |
| | | 3 | | namespace Intentum.AI.SystemOne; |
| | | 4 | | |
| | | 5 | | /// <summary>A typed System One question: choice, noul (yes/no) or score.</summary> |
| | | 6 | | /// <param name="Type">Question type: choice, noul or score.</param> |
| | | 7 | | /// <param name="Instructions">Human/model instructions describing the question.</param> |
| | | 8 | | /// <param name="Criteria">Choice: option → description map; score: ordered level list; noul: optional.</param> |
| | 5 | 9 | | public sealed record SystemOneQuestion( |
| | 5 | 10 | | [property: JsonPropertyName("type")] string Type, |
| | 5 | 11 | | [property: JsonPropertyName("instructions")] string Instructions, |
| | 10 | 12 | | [property: JsonPropertyName("criteria")] object? Criteria = null) |
| | | 13 | | { |
| | | 14 | | /// <summary>A choice question over named options.</summary> |
| | | 15 | | public static SystemOneQuestion Choice(string instructions, IReadOnlyDictionary<string, string?> criteria) => |
| | 3 | 16 | | new("choice", instructions, criteria); |
| | | 17 | | |
| | | 18 | | /// <summary>A score question over ordered levels (lowest first).</summary> |
| | | 19 | | public static SystemOneQuestion Score(string instructions, IReadOnlyList<string> criteria) => |
| | 1 | 20 | | new("score", instructions, criteria); |
| | | 21 | | |
| | | 22 | | /// <summary>A yes/no question; the answer carries the probability of yes.</summary> |
| | | 23 | | public static SystemOneQuestion Noul(string instructions) => |
| | 1 | 24 | | new("noul", instructions); |
| | | 25 | | } |