Repository navigation
Expand file tree
/
Copy pathLlmTestServerVerification.cs
More file actions
80 lines (71 loc) · 2.91 KB
/
Copy pathLlmTestServerVerification.cs
File metadata and controls
80 lines (71 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using ManagedCode.LlmTestServer.Conversations;
using ManagedCode.LlmTestServer.Diagnostics;
namespace ManagedCode.LlmTestServer.Verification;
public sealed record LlmTestServerVerificationRequest
{
public LlmTestServerRequestQuery Scope { get; init; } = new();
public List<LlmTestServerRequestExpectation> Requests { get; init; } = [];
public bool InOrder { get; init; }
public bool NoUnexpectedCalls { get; init; }
public List<LlmTestServerConversationExpectation> Conversations { get; init; } = [];
public List<LlmTestServerRetryExpectation> Retries { get; init; } = [];
}
public sealed record LlmTestServerRequestExpectation
{
public string Name { get; init; } = "request";
public LlmTestServerRequestQuery Query { get; init; } = new();
public int MinimumCount { get; init; } = 1;
public int? MaximumCount { get; init; } = 1;
public bool RequireStreamingTerminalMarker { get; init; }
public List<LlmTestServerToolExpectation> Tools { get; init; } = [];
}
public enum LlmTestServerToolEvidenceKind
{
ResponseCall,
RequestCall,
Result,
}
public sealed record LlmTestServerToolExpectation
{
public LlmTestServerToolEvidenceKind Kind { get; init; }
public string? Name { get; init; }
public string? CallId { get; init; }
public string? ArgumentsJson { get; init; }
public string? ResultJson { get; init; }
public List<LlmTestServerJsonFieldMatch> ResultFields { get; init; } = [];
public int MinimumCount { get; init; } = 1;
public int? MaximumCount { get; init; } = 1;
}
public sealed record LlmTestServerConversationExpectation
{
public string ScenarioId { get; init; } = string.Empty;
public string? ConversationId { get; init; }
public string? ProviderNamespace { get; init; }
public List<string> VisitedSteps { get; init; } = [];
public bool RequireTerminal { get; init; }
}
public sealed record LlmTestServerRetryExpectation
{
public string GroupId { get; init; } = string.Empty;
public LlmTestServerRequestQuery Query { get; init; } = new();
public int MinimumAttempts { get; init; } = 1;
public int MaximumAttempts { get; init; } = 3;
public List<int> StatusSequence { get; init; } = [];
public double? MinimumRetryAfterSeconds { get; init; }
public bool RespectRetryAfter { get; init; }
}
public sealed record LlmTestServerVerificationResult
{
public bool Passed { get; init; }
public bool EvidenceComplete { get; init; }
public List<LlmTestServerVerificationFailure> Failures { get; init; } = [];
public List<string> MatchedRequestIds { get; init; } = [];
}
public sealed record LlmTestServerVerificationFailure
{
public string Code { get; init; } = string.Empty;
public string Expectation { get; init; } = string.Empty;
public string Expected { get; init; } = string.Empty;
public string Actual { get; init; } = string.Empty;
public List<string> RequestIds { get; init; } = [];
}