-
Notifications
You must be signed in to change notification settings - Fork 381
[Agents] Add ability to generate attachment files on the fly + new parts to simplify test results lookup #8381
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
Changes from all commits
Commits
Show all changes
11 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 c30a446
Remove intent
qutreson 64428a1
Better handle part
qutreson 27c6c5b
Revert change
qutreson 30cbfec
Remove unused using
qutreson cf42123
Remove unnecessary changes
qutreson 4ca9fca
Apply suggestion from @github-actions[bot]
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
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
73 changes: 73 additions & 0 deletions
73
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,73 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // 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; | ||
|
|
||
| using System.Agents; | ||
|
|
||
| page 149050 "AIT Agent Log Entry Part" | ||
| { | ||
| Caption = 'Agent Details'; | ||
| PageType = ListPart; | ||
| Editable = false; | ||
| SourceTable = "Agent Task Log"; | ||
|
|
||
| layout | ||
| { | ||
| area(Content) | ||
| { | ||
| repeater(Tasks) | ||
| { | ||
| field("Agent Task ID"; Rec."Agent Task ID") | ||
| { | ||
| Caption = 'Task ID'; | ||
| ApplicationArea = All; | ||
| ToolTip = 'Specifies the Agent Task ID.'; | ||
|
|
||
| trigger OnDrillDown() | ||
| begin | ||
| AgentTestContextImpl.OpenAgentTaskList(Format(Rec."Agent Task ID")); | ||
| end; | ||
| } | ||
| field(NumberOfStepsDone; NumberOfStepsDone) | ||
| { | ||
| Caption = 'Steps Done'; | ||
| ApplicationArea = All; | ||
| ToolTip = 'Specifies the number of steps that have been done for the specific task.'; | ||
|
|
||
| trigger OnDrillDown() | ||
| begin | ||
| AgentTask.OpenAgentTaskLogEntries(Rec."Agent Task ID"); | ||
| end; | ||
| } | ||
| field("Copilot Credits"; CopilotCredits) | ||
| { | ||
| ApplicationArea = All; | ||
| AutoFormatType = 0; | ||
| Caption = 'Copilot Credits'; | ||
| ToolTip = 'Specifies the Copilot Credits consumed by this Agent Task.'; | ||
|
|
||
| trigger OnDrillDown() | ||
| begin | ||
| AgentConsumptionOverview.OpenAgentTaskConsumptionOverview(Rec."Agent Task ID"); | ||
| end; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| var | ||
| AgentConsumptionOverview: Codeunit "Agent Consumption Overview"; | ||
| AgentTask: Codeunit "Agent Task"; | ||
| AgentTestContextImpl: Codeunit "Agent Test Context Impl."; | ||
| CopilotCredits: Decimal; | ||
| NumberOfStepsDone: Integer; | ||
|
qutreson marked this conversation as resolved.
|
||
|
|
||
| trigger OnAfterGetRecord() | ||
| begin | ||
| CopilotCredits := AgentConsumptionOverview.GetCopilotCreditsConsumed(Rec."Agent Task ID"); | ||
|
qutreson marked this conversation as resolved.
|
||
| NumberOfStepsDone := AgentTask.GetStepsDoneCount(Rec."Agent Task ID"); | ||
| 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
112 changes: 112 additions & 0 deletions
112
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,112 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // 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) | ||
|
qutreson marked this conversation as resolved.
qutreson marked this conversation as resolved.
|
||
| { | ||
| 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'; | ||
| Visible = ErrorMessage <> ''; | ||
|
|
||
| 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; | ||
|
|
||
|
qutreson marked this conversation as resolved.
|
||
| 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
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.
Uh oh!
There was an error while loading. Please reload this page.