-
Notifications
You must be signed in to change notification settings - Fork 381
[WIP][Agent Library] #8375
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
Draft
qutreson
wants to merge
5
commits into
main
Choose a base branch
from
bugs/tfs/636582-LLM
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+377
−11
Draft
[WIP][Agent Library] #8375
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5a325d8
Agent Test Library improvements
qutreson 06a6778
Fix attachment generator
qutreson 072da53
Adding factboxes to simply checking test results
qutreson 0618f45
Update file generator syntax
qutreson 3e9be5a
Change format and improve LLM judge
qutreson 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
55 changes: 55 additions & 0 deletions
55
src/Tools/AI Test Toolkit/src/Agent/AITAgentLogEntryPart.Page.al
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,55 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
|
|
||
| namespace System.TestTools.AITestToolkit; | ||
|
|
||
| page 149050 "AIT Agent Log Entry Part" | ||
| { | ||
| Caption = 'Agent Details'; | ||
| PageType = CardPart; | ||
| Editable = false; | ||
| SourceTable = "AIT Log Entry"; | ||
|
|
||
| layout | ||
| { | ||
| area(Content) | ||
| { | ||
| field("Agent Task IDs"; AgentTaskIDs) | ||
| { | ||
| ApplicationArea = All; | ||
| Caption = 'Agent Tasks Executed'; | ||
| ToolTip = 'Specifies the comma-separated list of Agent Task IDs related to this log entry.'; | ||
|
|
||
| trigger OnDrillDown() | ||
| begin | ||
| AgentTestContextImpl.OpenAgentTaskList(AgentTaskIDs); | ||
| end; | ||
| } | ||
| field("Copilot Credits"; CopilotCredits) | ||
| { | ||
| ApplicationArea = All; | ||
| AutoFormatType = 0; | ||
| Caption = 'Copilot Credits Consumed'; | ||
| ToolTip = 'Specifies the total Copilot Credits consumed by the Agent Tasks for this log entry.'; | ||
|
|
||
| trigger OnDrillDown() | ||
| begin | ||
| AgentTestContextImpl.OpenAgentConsumptionOverview(AgentTaskIDs); | ||
| end; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| var | ||
| AgentTestContextImpl: Codeunit "Agent Test Context Impl."; | ||
| CopilotCredits: Decimal; | ||
| AgentTaskIDs: Text; | ||
|
|
||
| trigger OnAfterGetRecord() | ||
| begin | ||
| CopilotCredits := AgentTestContextImpl.GetCopilotCreditsForLogEntry(Rec."Entry No."); | ||
| AgentTaskIDs := AgentTestContextImpl.GetAgentTaskIDsForLogEntry(Rec."Entry No."); | ||
| end; | ||
| } | ||
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
110 changes: 110 additions & 0 deletions
110
src/Tools/AI Test Toolkit/src/Logs/AITLogEntryOutcomePart.Page.al
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,110 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
|
|
||
| namespace System.TestTools.AITestToolkit; | ||
|
|
||
| page 149049 "AIT Log Entry Outcome Part" | ||
| { | ||
| ApplicationArea = All; | ||
| Caption = 'Test Outcome'; | ||
| PageType = CardPart; | ||
| Editable = false; | ||
| SourceTable = "AIT Log Entry"; | ||
| Extensible = true; | ||
|
|
||
| layout | ||
| { | ||
| area(Content) | ||
| { | ||
| field(Status; Rec.Status) | ||
| { | ||
| StyleExpr = StatusStyleExpr; | ||
| } | ||
| field(Accuracy; Rec."Test Method Line Accuracy") | ||
| { | ||
| Caption = 'Evaluation Result'; | ||
| ToolTip = 'Specifies the accuracy of the eval line.'; | ||
| AutoFormatType = 0; | ||
| } | ||
| field(TurnsText; TurnsText) | ||
| { | ||
| Caption = 'No. of Turns Passed'; | ||
| ToolTip = 'Specifies the number of turns that passed out of the total number of turns.'; | ||
| StyleExpr = TurnsStyleExpr; | ||
| } | ||
| group(ErrorMessageGroup) | ||
| { | ||
| Caption = 'Error Message'; | ||
| field(ErrorMessage; ErrorMessage) | ||
| { | ||
| ShowCaption = false; | ||
| ToolTip = 'Specifies the error message from the eval.'; | ||
| Style = Unfavorable; | ||
| Multiline = true; | ||
|
|
||
| trigger OnDrillDown() | ||
| begin | ||
| Message(ErrorMessage); | ||
| end; | ||
| } | ||
| } | ||
| field(Duration; Rec."Duration (ms)") | ||
| { | ||
| Caption = 'Duration (ms)'; | ||
| ToolTip = 'Specifies the duration of the test execution in milliseconds.'; | ||
| AutoFormatType = 0; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| var | ||
| TurnsText: Text; | ||
| ErrorMessage: Text; | ||
| StatusStyleExpr: Text; | ||
| TurnsStyleExpr: Text; | ||
|
|
||
| trigger OnAfterGetRecord() | ||
| var | ||
| AITTestSuiteMgt: Codeunit "AIT Test Suite Mgt."; | ||
| begin | ||
| TurnsText := AITTestSuiteMgt.GetTurnsAsText(Rec); | ||
| SetStatusStyleExpr(); | ||
| SetTurnsStyleExpr(); | ||
| SetErrorMessage(); | ||
| end; | ||
|
|
||
| local procedure SetStatusStyleExpr() | ||
| begin | ||
| case Rec.Status of | ||
| Rec.Status::Success: | ||
| StatusStyleExpr := Format(PageStyle::Favorable); | ||
| Rec.Status::Error: | ||
| StatusStyleExpr := Format(PageStyle::Unfavorable); | ||
| Rec.Status::Skipped: | ||
| StatusStyleExpr := Format(PageStyle::Ambiguous); | ||
| else | ||
| StatusStyleExpr := ''; | ||
| end; | ||
| end; | ||
|
|
||
| local procedure SetTurnsStyleExpr() | ||
| begin | ||
| case Rec."No. of Turns Passed" of | ||
| Rec."No. of Turns": | ||
| TurnsStyleExpr := Format(PageStyle::Favorable); | ||
| 0: | ||
| TurnsStyleExpr := Format(PageStyle::Unfavorable); | ||
| else | ||
| TurnsStyleExpr := Format(PageStyle::Ambiguous); | ||
| end; | ||
| end; | ||
|
|
||
| local procedure SetErrorMessage() | ||
| begin | ||
| ErrorMessage := ''; | ||
| if Rec.Status = Rec.Status::Error then | ||
| ErrorMessage := Rec.GetMessage(); | ||
| end; | ||
| } |
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
15 changes: 15 additions & 0 deletions
15
src/Tools/Test Framework/Test Libraries/LibraryAgent/src/AgentTestLLMJudgeCap.EnumExt.al
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,15 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
| namespace System.TestLibraries.AI; | ||
|
|
||
| using System.AI; | ||
|
|
||
| enumextension 130566 "Agent Test LLM Judge Cap." extends "Copilot Capability" | ||
| { | ||
| value(130566; "Agent Test LLM Judge") | ||
| { | ||
| Caption = 'Agent Test Library LLM Judge'; | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets also add the link to the steps (log entries) directly. Maybe number of steps