1 write to Context
Microsoft.Extensions.AI.Evaluation (1)
EvaluationMetricExtensions.cs (1)
30
metric.
Context
??= new Dictionary<string, EvaluationContext>();
36 references to Context
Microsoft.Extensions.AI.Evaluation (7)
EvaluationContext.cs (4)
33
/// that it used, in the <see cref="EvaluationMetric.
Context
"/> property of each <see cref="EvaluationMetric"/> that it
36
/// <see cref="EvaluationContext"/>s recorded within the <see cref="EvaluationMetric.
Context
"/> will also be
82
/// <see cref="EvaluationContext"/>s that it used, in the <see cref="EvaluationMetric.
Context
"/> property of each
86
/// within the <see cref="EvaluationMetric.
Context
"/> will also be serialized. However, for each such
EvaluationMetricExtensions.cs (3)
19
/// <see cref="EvaluationMetric.
Context
"/> dictionary.
34
metric.
Context
[c.Name] = c;
41
/// <see cref="EvaluationMetric.
Context
"/> dictionary.
Microsoft.Extensions.AI.Evaluation.Integration.Tests (20)
QualityEvaluatorTests.cs (12)
186
Assert.Null(groundedness.
Context
);
187
Assert.Null(equivalence.
Context
);
188
Assert.Null(completeness.
Context
);
189
Assert.Null(retrieval.
Context
);
261
groundedness.
Context
?.Count is 1 &&
262
groundedness.
Context
.TryGetValue(GroundednessEvaluatorContext.GroundingContextName, out EvaluationContext? context1) &&
266
equivalence.
Context
?.Count is 1 &&
267
equivalence.
Context
.TryGetValue(EquivalenceEvaluatorContext.GroundTruthContextName, out EvaluationContext? context2) &&
271
completeness.
Context
?.Count is 1 &&
272
completeness.
Context
.TryGetValue(CompletenessEvaluatorContext.GroundTruthContextName, out EvaluationContext? context3) &&
276
retrieval.
Context
?.Count is 1 &&
277
retrieval.
Context
.TryGetValue(RetrievalEvaluatorContext.RetrievedContextChunksContextName, out EvaluationContext? context4) &&
SafetyEvaluatorTests.cs (8)
175
groundednessPro.
Context
?.Count is 1 &&
176
groundednessPro.
Context
.TryGetValue(GroundednessProEvaluatorContext.GroundingContextName, out EvaluationContext? context1) &&
180
ungroundedAttributes.
Context
?.Count is 1 &&
181
ungroundedAttributes.
Context
.TryGetValue(UngroundedAttributesEvaluatorContext.GroundingContextName, out EvaluationContext? context2) &&
250
groundednessPro.
Context
?.Count is 1 &&
251
groundednessPro.
Context
.TryGetValue(GroundednessProEvaluatorContext.GroundingContextName, out EvaluationContext? context1) &&
255
ungroundedAttributes.
Context
?.Count is 1 &&
256
ungroundedAttributes.
Context
.TryGetValue(UngroundedAttributesEvaluatorContext.GroundingContextName, out EvaluationContext? context2) &&
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (9)
ScenarioRunResultTests.cs (9)
264
Assert.Equal(metric.
Context
is null, deserializedMetric.
Context
is null);
265
if (metric.
Context
is not null && deserializedMetric.
Context
is not null)
267
Assert.Equal(metric.
Context
.Count, deserializedMetric.
Context
.Count);
268
foreach (var key in metric.
Context
.Keys)
270
Assert.Equal(metric.
Context
[key], deserializedMetric.
Context
[key], ContextComparer.Instance);