| | | 1 | | namespace EHonda.KicktippAi.Core; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Stable metadata for a context document version resolved during prompt reconstruction. |
| | | 5 | | /// </summary> |
| | 1 | 6 | | public record ResolvedContextDocumentVersion( |
| | 1 | 7 | | string DocumentName, |
| | 1 | 8 | | int Version, |
| | 1 | 9 | | DateTimeOffset CreatedAt, |
| | 1 | 10 | | string Content); |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Reconstructed match prompt inputs for a historical prediction. |
| | | 14 | | /// </summary> |
| | | 15 | | public record ReconstructedMatchPredictionPrompt( |
| | | 16 | | Match Match, |
| | | 17 | | string Model, |
| | | 18 | | string CommunityContext, |
| | | 19 | | bool IncludeJustification, |
| | | 20 | | DateTimeOffset PromptTimestamp, |
| | | 21 | | string PromptTemplatePath, |
| | | 22 | | string SystemPrompt, |
| | | 23 | | string MatchJson, |
| | | 24 | | IReadOnlyList<string> ContextDocumentNames, |
| | | 25 | | IReadOnlyList<ResolvedContextDocumentVersion> ResolvedContextDocuments); |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Reconstructs prompt inputs for historical match predictions. |
| | | 29 | | /// </summary> |
| | | 30 | | public interface IMatchPromptReconstructionService |
| | | 31 | | { |
| | | 32 | | /// <summary> |
| | | 33 | | /// Reconstructs the prompt inputs used for a stored match prediction. |
| | | 34 | | /// </summary> |
| | | 35 | | /// <param name="match">The match whose historical prediction should be reconstructed.</param> |
| | | 36 | | /// <param name="model">The model that was used for the stored prediction.</param> |
| | | 37 | | /// <param name="communityContext">The community context used for the stored prediction.</param> |
| | | 38 | | /// <param name="includeJustification">Whether to reconstruct the justification prompt variant.</param> |
| | | 39 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | | 40 | | /// <returns>The reconstructed prompt inputs if the prediction exists; otherwise <c>null</c>.</returns> |
| | | 41 | | Task<ReconstructedMatchPredictionPrompt?> ReconstructMatchPredictionPromptAsync( |
| | | 42 | | Match match, |
| | | 43 | | string model, |
| | | 44 | | string communityContext, |
| | | 45 | | bool includeJustification = false, |
| | | 46 | | CancellationToken cancellationToken = default); |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Reconstructs the prompt inputs for a match at an explicit evaluation timestamp. |
| | | 50 | | /// </summary> |
| | | 51 | | /// <param name="match">The match whose prompt should be reconstructed.</param> |
| | | 52 | | /// <param name="model">The model whose template should be used.</param> |
| | | 53 | | /// <param name="communityContext">The community context used for document resolution.</param> |
| | | 54 | | /// <param name="promptTimestamp">The exact timestamp to use when resolving versioned context documents.</param> |
| | | 55 | | /// <param name="requiredContextDocumentNames">Context documents that must exist at the supplied timestamp.</param> |
| | | 56 | | /// <param name="optionalContextDocumentNames">Context documents that should be included when available.</param> |
| | | 57 | | /// <param name="includeJustification">Whether to reconstruct the justification prompt variant.</param> |
| | | 58 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | | 59 | | /// <returns>The reconstructed prompt inputs.</returns> |
| | | 60 | | Task<ReconstructedMatchPredictionPrompt> ReconstructMatchPredictionPromptAtTimestampAsync( |
| | | 61 | | Match match, |
| | | 62 | | string model, |
| | | 63 | | string communityContext, |
| | | 64 | | DateTimeOffset promptTimestamp, |
| | | 65 | | IReadOnlyList<string> requiredContextDocumentNames, |
| | | 66 | | IReadOnlyList<string>? optionalContextDocumentNames = null, |
| | | 67 | | bool includeJustification = false, |
| | | 68 | | CancellationToken cancellationToken = default); |
| | | 69 | | } |