-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding AI evaluations based on Microsoft.Extensions.AI.Evaluati…
…on and Aspire.Hosting.Testing (#8)
- Loading branch information
1 parent
44fc1df
commit cc9fa66
Showing
27 changed files
with
558 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"microsoft.extensions.ai.evaluation.console": { | ||
"version": "0.9.56-preview", | ||
"commands": [ | ||
"aieval" | ||
], | ||
"rollForward": false | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/ChatApp.EvaluationTests/ChatApp.EvaluationTests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Aspire.Hosting.Testing" Version="9.0.0" /> | ||
<PackageReference Include="coverlet.collector" Version="6.0.2" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" /> | ||
<PackageReference Include="xunit" Version="2.9.2" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" /> | ||
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.1.0-preview.1.25064.3" /> | ||
<PackageReference Include="Microsoft.Extensions.AI.Evaluation" Version="0.9.56-preview" /> | ||
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Quality" Version="0.9.56-preview" /> | ||
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Reporting" Version="0.9.56-preview" /> | ||
<PackageReference Include="Microsoft.ML.Tokenizers" Version="1.0.1" /> | ||
<PackageReference Include="Microsoft.ML.Tokenizers.Data.O200kBase" Version="1.0.1" /> | ||
<PackageReference Include="YamlDotNet" Version="16.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ChatApp.AppHost\ChatApp.AppHost.csproj" /> | ||
<ProjectReference Include="..\ChatApp.ServiceDefaults\ChatApp.ServiceDefaults.csproj" /> | ||
|
||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> | ||
<_Parameter1>EvalQuestionsJsonPath</_Parameter1> | ||
<_Parameter2>$(ProjectDir)..\data\test\eval_inputs.json</_Parameter2> | ||
</AssemblyAttribute> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="appsettings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="System.Net" /> | ||
<Using Include="Microsoft.Extensions.DependencyInjection" /> | ||
<Using Include="Aspire.Hosting.ApplicationModel" /> | ||
<Using Include="Aspire.Hosting.Testing" /> | ||
<Using Include="Xunit" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Xunit.Abstractions; | ||
|
||
namespace ChatApp.EvaluationTests; | ||
|
||
public class EvalQuestion : IXunitSerializable | ||
{ | ||
public required int ScenarioId { get; set; } | ||
|
||
public required string ResearchContext { get; set; } | ||
|
||
public required string ProductContext { get; set; } | ||
|
||
public required string AssignmentContext { get; set; } | ||
|
||
void IXunitSerializable.Deserialize(IXunitSerializationInfo info) | ||
{ | ||
ScenarioId = info.GetValue<int>("ScenarioId"); | ||
ResearchContext = info.GetValue<string>("ResearchContext"); | ||
ProductContext = info.GetValue<string>("ProductContext"); | ||
AssignmentContext = info.GetValue<string>("AssignmentContext"); | ||
} | ||
|
||
void IXunitSerializable.Serialize(IXunitSerializationInfo info) | ||
{ | ||
info.AddValue("ScenarioId", ScenarioId); | ||
info.AddValue("ResearchContext", ResearchContext); | ||
info.AddValue("ProductContext", ProductContext); | ||
info.AddValue("AssignmentContext", AssignmentContext); | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $"Scenario = {ScenarioId}"; | ||
} | ||
} |
Oops, something went wrong.