Skip to content

Commit 3bb2efb

Browse files
Update eval samples (#134)
1 parent 1b517b0 commit 3bb2efb

15 files changed

+94
-66
lines changed

src/microsoft-extensions-ai-evaluation/api/.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"microsoft.extensions.ai.evaluation.console": {
6-
"version": "9.7.0",
6+
"version": "9.8.0",
77
"commands": [
88
"aieval"
99
],

src/microsoft-extensions-ai-evaluation/api/INSTRUCTIONS.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,22 @@ AI Foundry Evaluation service and require some special setup. The corresponding
128128
be enabled by setting the following environment variables.
129129

130130
1. Firstly, you need an [Azure subscription](https://azure.microsoft.com/).
131-
2. Within this subscription, create a
132-
[resource group](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal)
133-
within one of the
134-
[Azure regions that support Azure AI Foundry Evaluation service](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/develop/evaluate-sdk#region-support).
135-
3. Next create an [Azure AI hub](https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/ai-resources) within the
136-
same resource group and region.
137-
4. Finally, create an [Azure AI project](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/create-projects?tabs=ai-studio)
138-
within this hub.
139-
5. Once you have created the above artifacts, set the following environment variables to configure the examples to use
140-
the Azure AI Foundry Evaluation service from the above AI project.
131+
2. Within this subscription, create an [Azure AI Foundry project](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/create-projects?tabs=ai-foundry&pivots=fdp-project).
132+
3. Finally, copy the endpoint URL for the above Azure AI Foundry project and set the following environment variable.
133+
This will configure the examples to use the Azure AI Foundry Evaluation service from the above Azure AI Foundry
134+
project.
135+
136+
```
137+
set EVAL_SAMPLE_AZURE_AI_PROJECT_ENDPOINT=<The endpoint URL for the above Azure AI Foundry project>
138+
```
139+
140+
**Note:** If you are using an older [hub-based Azure AI Foundry project](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/create-projects?tabs=ai-foundry&pivots=hub-project),
141+
set the following environment variables instead.
141142

142143
```
143-
set EVAL_SAMPLE_AZURE_SUBSCRIPTION_ID=<The ID of the above Azure subscription>
144-
set EVAL_SAMPLE_AZURE_RESOURCE_GROUP=<The name of the above Azure resource group>
145-
set EVAL_SAMPLE_AZURE_AI_PROJECT=<The name of the above Azure AI project>
144+
set EVAL_SAMPLE_AZURE_SUBSCRIPTION_ID=<The ID of the Azure subscription containing your hub-based Azure AI Foundry project>
145+
set EVAL_SAMPLE_AZURE_RESOURCE_GROUP=<The name of the Azure resource group containing your hub-based Azure AI Foundry project>
146+
set EVAL_SAMPLE_AZURE_AI_PROJECT=<The name of the your hub-based Azure AI Foundry project>
146147
```
147148

148149
## Running Azure storage examples
@@ -164,7 +165,7 @@ variables.
164165
the storage container created above.
165166

166167
```
167-
set EVAL_SAMPLE_AZURE_STORAGE_ACCOUNT_ENDPOINT=<The endpoint url of the above Azure storage account>
168+
set EVAL_SAMPLE_AZURE_STORAGE_ACCOUNT_ENDPOINT=<The endpoint URL of the above Azure storage account>
168169
set EVAL_SAMPLE_AZURE_STORAGE_CONTAINER=<The name of the above Azure storage container>
169170
```
170171

src/microsoft-extensions-ai-evaluation/api/evaluation/Evaluation.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Azure.AI.OpenAI" Version="2.1.0" />
14-
<PackageReference Include="Azure.Identity" Version="1.14.2" />
14+
<PackageReference Include="Azure.Identity" Version="1.15.0" />
1515
<PackageReference Include="AwesomeAssertions" Version="9.1.0" />
16-
<PackageReference Include="Microsoft.Extensions.AI" Version="9.7.1" />
17-
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.7.1" />
18-
<PackageReference Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.7.1-preview.1.25365.4" />
19-
<PackageReference Include="Microsoft.Extensions.AI.Evaluation" Version="9.7.0" />
20-
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Quality" Version="9.7.0" />
21-
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.7.1-preview.1.25365.4" />
16+
<PackageReference Include="Microsoft.Extensions.AI" Version="9.8.0" />
17+
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.8.0" />
18+
<PackageReference Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.8.0-preview.1.25412.6" />
19+
<PackageReference Include="Microsoft.Extensions.AI.Evaluation" Version="9.8.0" />
20+
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Quality" Version="9.8.0" />
21+
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.8.0-preview.1.25412.6" />
2222
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
23-
<PackageReference Include="MSTest.TestAdapter" Version="3.9.3" />
24-
<PackageReference Include="MSTest.TestFramework" Version="3.9.3" />
25-
<PackageReference Include="OllamaSharp" Version="5.3.1" />
23+
<PackageReference Include="MSTest.TestAdapter" Version="3.10.4" />
24+
<PackageReference Include="MSTest.TestFramework" Version="3.10.4" />
25+
<PackageReference Include="OllamaSharp" Version="5.3.6" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

src/microsoft-extensions-ai-evaluation/api/evaluation/EvaluationExamples.Example04_InvokingCustomEvaluators.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Evaluation.Evaluators;
65
using AwesomeAssertions;
76
using AwesomeAssertions.Execution;
7+
using Evaluation.Evaluators;
88
using Microsoft.Extensions.AI.Evaluation;
99

1010
namespace Evaluation;

src/microsoft-extensions-ai-evaluation/api/evaluation/EvaluationExamples.Example05_AttachingDiagnosticsToMetrics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Evaluation.Evaluators;
65
using AwesomeAssertions;
76
using AwesomeAssertions.Execution;
7+
using Evaluation.Evaluators;
88
using Microsoft.Extensions.AI.Evaluation;
99

1010
namespace Evaluation;

src/microsoft-extensions-ai-evaluation/api/evaluation/EvaluationExamples.Example06_ChangingInterpretationOfMetrics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Evaluation.Evaluators;
65
using AwesomeAssertions;
76
using AwesomeAssertions.Execution;
7+
using Evaluation.Evaluators;
88
using Microsoft.Extensions.AI.Evaluation;
99

1010
namespace Evaluation;

src/microsoft-extensions-ai-evaluation/api/evaluation/Setup/EnvironmentVariables.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public static string OpenAIModel
7575
#endregion
7676

7777
#region Azure AI Foundry (for content safety evaluation examples)
78+
public const string AzureAIProjectEndpointVariableName = "EVAL_SAMPLE_AZURE_AI_PROJECT_ENDPOINT";
79+
public static string? AzureAIProjectEndpoint =>
80+
TryGetEnvironmentVariable(AzureAIProjectEndpointVariableName, out string? value)
81+
? value
82+
: null;
83+
7884
public const string AzureSubscriptionIdVariableName = "EVAL_SAMPLE_AZURE_SUBSCRIPTION_ID";
7985
public static string? AzureSubscriptionId =>
8086
TryGetEnvironmentVariable(AzureSubscriptionIdVariableName, out string? value)

src/microsoft-extensions-ai-evaluation/api/reporting/Reporting.csproj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Azure.AI.OpenAI" Version="2.1.0" />
14-
<PackageReference Include="Azure.Identity" Version="1.14.2" />
14+
<PackageReference Include="Azure.Identity" Version="1.15.0" />
1515
<PackageReference Include="AwesomeAssertions" Version="9.1.0" />
16-
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.7" />
17-
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.7.1" />
18-
<PackageReference Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.7.1-preview.1.25365.4" />
19-
<PackageReference Include="Microsoft.Extensions.AI.Evaluation" Version="9.7.0" />
20-
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.NLP" Version="9.7.0-preview.1.25356.2" />
21-
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Quality" Version="9.7.0" />
22-
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Reporting" Version="9.7.0" />
23-
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Reporting.Azure" Version="9.7.0" />
24-
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Safety" Version="9.7.0-preview.1.25356.2" />
25-
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.7.1-preview.1.25365.4" />
16+
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.8" />
17+
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.8.0" />
18+
<PackageReference Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.8.0-preview.1.25412.6" />
19+
<PackageReference Include="Microsoft.Extensions.AI.Evaluation" Version="9.8.0" />
20+
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.NLP" Version="9.8.0-preview.1.25412.6" />
21+
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Quality" Version="9.8.0" />
22+
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Reporting" Version="9.8.0" />
23+
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Reporting.Azure" Version="9.8.0" />
24+
<PackageReference Include="Microsoft.Extensions.AI.Evaluation.Safety" Version="9.8.0-preview.1.25412.6" />
25+
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.8.0-preview.1.25412.6" />
2626
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
27-
<PackageReference Include="MSTest.TestAdapter" Version="3.9.3" />
28-
<PackageReference Include="MSTest.TestFramework" Version="3.9.3" />
29-
<PackageReference Include="OllamaSharp" Version="5.3.1" />
27+
<PackageReference Include="MSTest.TestAdapter" Version="3.10.4" />
28+
<PackageReference Include="MSTest.TestFramework" Version="3.10.4" />
29+
<PackageReference Include="OllamaSharp" Version="5.3.6" />
3030
</ItemGroup>
3131

3232
<ItemGroup>

src/microsoft-extensions-ai-evaluation/api/reporting/ReportingExamples.Example05_InvokingEvaluatorsThatNeedAdditionalContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Evaluation.Setup;
65
using AwesomeAssertions;
76
using AwesomeAssertions.Execution;
7+
using Evaluation.Setup;
88
using Microsoft.Extensions.AI;
99
using Microsoft.Extensions.AI.Evaluation;
1010
using Microsoft.Extensions.AI.Evaluation.Quality;

src/microsoft-extensions-ai-evaluation/api/reporting/ReportingExamples.Example06_AttachingDiagnosticsToMetrics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Evaluation.Evaluators;
65
using AwesomeAssertions;
76
using AwesomeAssertions.Execution;
7+
using Evaluation.Evaluators;
88
using Microsoft.Extensions.AI;
99
using Microsoft.Extensions.AI.Evaluation;
1010
using Microsoft.Extensions.AI.Evaluation.Reporting;

0 commit comments

Comments
 (0)