-
Notifications
You must be signed in to change notification settings - Fork 227
More Eval Scenarios #13402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
More Eval Scenarios #13402
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
79cb23a
new scenarios
jeo02 546e4d8
fix
jeo02 0534905
Better error message
jeo02 6aa870d
add in the final part of the conversation to results
jeo02 64058b1
mocks
jeo02 e3ed7f5
fix
jeo02 8bef6bf
remove and add
jeo02 35d100f
tweak + increase parallelization
jeo02 971973b
optional field
jeo02 f9cdde5
fix
jeo02 53da445
Merge branch 'main' into more-scenarios
jeo02 be0594c
fix merge conflict problems
jeo02 63e1c60
small fix
jeo02 7278275
add an optional tool
jeo02 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
42 changes: 42 additions & 0 deletions
42
...i/Azure.Sdk.Tools.Cli.Evaluations/Scenarios/AzureRestApiSpecs/Evaluate_CheckPublicRepo.cs
This file contains hidden or 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,42 @@ | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Evaluators; | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Helpers; | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Models; | ||
| using Microsoft.Extensions.AI.Evaluation; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Azure.Sdk.Tools.Cli.Evaluations.Scenarios | ||
| { | ||
| public partial class Scenario | ||
| { | ||
| [Test] | ||
| [Category(RepositoryCategories.AzureRestApiSpecs)] | ||
| public async Task Evaluate_CheckPublicRepo() | ||
| { | ||
| const string prompt = "Check if my TypeSpec project is in the public repo. My setup has already been verified, do not run azsdk_verify_setup. Project root: C:\\\\azure-rest-api-specs\\\\specification\\\\contosowidgetmanager\\\\Contoso.WidgetManager."; | ||
| string[] expectedTools = | ||
| [ | ||
| "azsdk_typespec_check_project_in_public_repo" | ||
| ]; | ||
|
|
||
| var scenarioData = ChatMessageHelper.LoadScenarioFromPrompt(prompt, expectedTools); | ||
| bool checkInputs = true; | ||
|
|
||
| var result = await EvaluationHelper.RunToolInputScenarioAsync( | ||
| scenarioName: this.ScenarioName, | ||
| scenarioData: scenarioData, | ||
| chatCompletion: s_chatCompletion!, | ||
| chatConfig: s_chatConfig!, | ||
| executionName: s_executionName, | ||
| reportingPath: ReportingPath, | ||
| toolNames: s_toolNames!, | ||
| evaluators: [new ExpectedToolInputEvaluator()], | ||
| enableResponseCaching: true, | ||
| additionalContexts: new EvaluationContext[] | ||
| { | ||
| new ExpectedToolInputEvaluatorContext(scenarioData.ExpectedOutcome, s_toolNames!, checkInputs) | ||
| }); | ||
|
|
||
| EvaluationHelper.ValidateToolInputsEvaluator(result); | ||
| } | ||
| } | ||
| } | ||
47 changes: 47 additions & 0 deletions
47
...Tools.Cli.Evaluations/Scenarios/AzureRestApiSpecs/Evaluate_CheckPublicRepoThenValidate.cs
This file contains hidden or 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,47 @@ | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Evaluators; | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Helpers; | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Models; | ||
| using Microsoft.Extensions.AI.Evaluation; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Azure.Sdk.Tools.Cli.Evaluations.Scenarios | ||
| { | ||
| public partial class Scenario | ||
| { | ||
| [Test] | ||
| [Category(RepositoryCategories.AzureRestApiSpecs)] | ||
| public async Task Evaluate_CheckPublicRepoThenValidate() | ||
| { | ||
| const string prompt = | ||
| "Confirm the TypeSpec project is in the public repo, then run TypeSpec validation. " + | ||
| "Project path: C\\:\\azure-rest-api-specs\\specification\\contosowidgetmanager\\Contoso.WidgetManager. " + | ||
jeo02 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "My setup has already been verified, do not run azsdk_verify_setup."; | ||
|
|
||
| string[] expectedTools = | ||
| [ | ||
| "azsdk_typespec_check_project_in_public_repo", | ||
| "azsdk_run_typespec_validation" | ||
| ]; | ||
|
|
||
| var scenarioData = ChatMessageHelper.LoadScenarioFromPrompt(prompt, expectedTools); | ||
| bool checkInputs = true; | ||
|
|
||
| var result = await EvaluationHelper.RunToolInputScenarioAsync( | ||
| scenarioName: this.ScenarioName, | ||
| scenarioData: scenarioData, | ||
| chatCompletion: s_chatCompletion!, | ||
| chatConfig: s_chatConfig!, | ||
| executionName: s_executionName, | ||
| reportingPath: ReportingPath, | ||
| toolNames: s_toolNames!, | ||
| evaluators: [new ExpectedToolInputEvaluator()], | ||
| enableResponseCaching: true, | ||
| additionalContexts: new EvaluationContext[] | ||
| { | ||
| new ExpectedToolInputEvaluatorContext(scenarioData.ExpectedOutcome, s_toolNames!, checkInputs) | ||
| }); | ||
|
|
||
| EvaluationHelper.ValidateToolInputsEvaluator(result); | ||
| } | ||
| } | ||
| } | ||
42 changes: 42 additions & 0 deletions
42
...Tools.Cli.Evaluations/Scenarios/AzureRestApiSpecs/Evaluate_GetModifiedTypespecProjects.cs
This file contains hidden or 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,42 @@ | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Evaluators; | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Helpers; | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Models; | ||
| using Microsoft.Extensions.AI.Evaluation; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Azure.Sdk.Tools.Cli.Evaluations.Scenarios | ||
| { | ||
| public partial class Scenario | ||
| { | ||
| [Test] | ||
| [Category(RepositoryCategories.AzureRestApiSpecs)] | ||
| public async Task Evaluate_GetModifiedTypespecProjects() | ||
| { | ||
| const string prompt = "List the TypeSpec projects modified in my repo. My setup has already been verified, do not run azsdk_verify_setup. Path to root: C:\\azure-rest-api-specs. Compare against main."; | ||
jeo02 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| string[] expectedTools = | ||
| [ | ||
| "azsdk_get_modified_typespec_projects" | ||
| ]; | ||
|
|
||
| var scenarioData = ChatMessageHelper.LoadScenarioFromPrompt(prompt, expectedTools); | ||
| bool checkInputs = true; | ||
|
|
||
| var result = await EvaluationHelper.RunToolInputScenarioAsync( | ||
| scenarioName: this.ScenarioName, | ||
| scenarioData: scenarioData, | ||
| chatCompletion: s_chatCompletion!, | ||
| chatConfig: s_chatConfig!, | ||
| executionName: s_executionName, | ||
| reportingPath: ReportingPath, | ||
| toolNames: s_toolNames!, | ||
| evaluators: [new ExpectedToolInputEvaluator()], | ||
| enableResponseCaching: true, | ||
| additionalContexts: new EvaluationContext[] | ||
| { | ||
| new ExpectedToolInputEvaluatorContext(scenarioData.ExpectedOutcome, s_toolNames!, checkInputs) | ||
| }); | ||
|
|
||
| EvaluationHelper.ValidateToolInputsEvaluator(result); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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
41 changes: 41 additions & 0 deletions
41
.../Azure.Sdk.Tools.Cli.Evaluations/Scenarios/General/Evaluate_LinkNamespaceApprovalIssue.cs
This file contains hidden or 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,41 @@ | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Evaluators; | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Helpers; | ||
| using Azure.Sdk.Tools.Cli.Evaluations.Models; | ||
| using Microsoft.Extensions.AI.Evaluation; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Azure.Sdk.Tools.Cli.Evaluations.Scenarios | ||
| { | ||
| public partial class Scenario | ||
| { | ||
| [Test] | ||
| public async Task Evaluate_LinkNamespaceApprovalIssue() | ||
| { | ||
| const string prompt = "Link namespace approval issue https://github.com/Azure/azure-sdk/issues/1234 to release plan 12345. My setup has already been verified, do not run azsdk_verify_setup."; | ||
| string[] expectedTools = | ||
| [ | ||
| "azsdk_link_namespace_approval_issue" | ||
| ]; | ||
|
|
||
| var scenarioData = ChatMessageHelper.LoadScenarioFromPrompt(prompt, expectedTools); | ||
| bool checkInputs = true; | ||
|
|
||
| var result = await EvaluationHelper.RunToolInputScenarioAsync( | ||
| scenarioName: this.ScenarioName, | ||
| scenarioData: scenarioData, | ||
| chatCompletion: s_chatCompletion!, | ||
| chatConfig: s_chatConfig!, | ||
| executionName: s_executionName, | ||
| reportingPath: ReportingPath, | ||
| toolNames: s_toolNames!, | ||
| evaluators: [new ExpectedToolInputEvaluator()], | ||
| enableResponseCaching: true, | ||
| additionalContexts: new EvaluationContext[] | ||
| { | ||
| new ExpectedToolInputEvaluatorContext(scenarioData.ExpectedOutcome, s_toolNames!, checkInputs) | ||
| }); | ||
|
|
||
| EvaluationHelper.ValidateToolInputsEvaluator(result); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.