db620d33df
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Evaluation - Simple Eval
The simplest agent evaluation: create a Foundry agent, run it against test questions, and use Foundry quality evaluators (Relevance, Coherence) to score the responses.
What this sample demonstrates
- Creating an agent with
AIProjectClient.AsAIAgent() - Using
FoundryEvalswith Relevance and Coherence quality evaluators - Running evaluation with
agent.EvaluateAsync()— runs the agent and evaluates in one call
Prerequisites
- .NET 10 SDK or later
- Azure authentication available to
DefaultAzureCredential(for local development, runaz login) - A deployed model in your Azure AI Foundry project
Set the following environment variables:
$env:FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project"
$env:FOUNDRY_MODEL="gpt-4o-mini"
Run the sample
cd dotnet/samples/02-agents/Evaluation
dotnet run --project .\Evaluation_SimpleEval
See also
- Evaluation_CustomEvals — Writing custom domain-specific evaluation checks
- Evaluation_ExpectedOutputs — Evaluating against ground-truth expected outputs
- Evaluation_MixedProviders — Combining local + Foundry evaluators in one call