mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-14 22:08:27 +00:00
Added the Model Comparison assistant for blind comparisons of two models (#1009)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
12f26445ba
commit
b7255694cd
221 files changed
+19989
-90
No files matched your search
@@ -0,0 +1,42 @@
|
||||
namespace AIStudio.Assistants.ModelComparison;
|
||||
|
||||
/// <summary>
|
||||
/// What a comparison run brought back: the answers of the two models.
|
||||
/// </summary>
|
||||
public sealed record ModelComparisonRunResult
|
||||
{
|
||||
/// <summary>
|
||||
/// When the run ended. Both answers are shown with this one time: a time of their own would
|
||||
/// tell the faster model from the slower one.
|
||||
/// </summary>
|
||||
public DateTimeOffset Time { get; init; } = DateTimeOffset.Now;
|
||||
|
||||
public required ModelComparisonAnswer First { get; init; }
|
||||
|
||||
public required ModelComparisonAnswer Second { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// What an optional judge said about the two answers, or null when no judge was asked, or when
|
||||
/// there was nothing for it to judge because at least one model did not answer.
|
||||
/// </summary>
|
||||
public ModelComparisonJudgeVerdict? Judge { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether both models answered. Only then there is anything to vote on: a vote between an
|
||||
/// answer and a failure would say nothing about the models.
|
||||
/// </summary>
|
||||
public bool BothCompleted => this.First.Completed && this.Second.Completed;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the answer of a model of the run.
|
||||
/// </summary>
|
||||
/// <param name="model">The first or the second model; a tie names no model.</param>
|
||||
/// <returns>The answer of that model.</returns>
|
||||
public ModelComparisonAnswer AnswerOf(ModelComparisonModelChoice model) => model switch
|
||||
{
|
||||
ModelComparisonModelChoice.FIRST => this.First,
|
||||
ModelComparisonModelChoice.SECOND => this.Second,
|
||||
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(model), model, $"The choice '{model}' names no model."),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user