File tree Expand file tree Collapse file tree
src/System Application/App/Agent/Monetization Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ codeunit 4333 "Agent Consumption Overview"
1010{
1111 InherentEntitlements = X;
1212 InherentPermissions = X;
13- Permissions = tabledata "Agent Task" = r,
14- tabledata "User AI Consumption Data" = r;
13+ Permissions = tabledata "Agent Task" = r;
1514
1615 // / <summary>
1716 // / Gets the total Copilot credits consumed by the agent task.
@@ -20,11 +19,9 @@ codeunit 4333 "Agent Consumption Overview"
2019 // / <returns>The total Copilot credits consumed by the agent task.</returns>
2120 procedure GetCopilotCreditsConsumed( TaskId: BigInteger ) : Decimal
2221 var
23- UserAIConsumptionData: Record "User AI Consumption Data ";
22+ AgentUtilities: Codeunit "Agent Utilities ";
2423 begin
25- UserAIConsumptionData. SetRange( "Agent Task Id", TaskId) ;
26- UserAIConsumptionData. CalcSums( "Copilot Credits") ;
27- exit ( UserAIConsumptionData. "Copilot Credits") ;
24+ exit ( AgentUtilities. GetConsumedCopilotCredits( TaskId)) ;
2825 end ;
2926
3027 // / <summary>
You can’t perform that action at this time.
0 commit comments