Skip to content

Commit

Permalink
Porting fix to 25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
darjoo authored and nikolakukrika committed Sep 10, 2024
1 parent f1ea5c6 commit 01de27c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ codeunit 7771 "Azure OpenAI"
exit(AzureOpenAIImpl.IsEnabled(CopilotCapability, Silent, CallerModuleInfo));
end;

/// <summary>
/// Checks if the Azure OpenAI API is enabled for the environment and if the capability is active on the environment.
/// </summary>
/// <param name="CopilotCapability">The copilot capability to check.</param>
/// <param name="Silent">If true, no error message will be shown if API is not enabled.</param>
/// <param name="AppId">The id of the app, which registered the copilot capability.</param>
/// <returns>True if API and capability is enabled for environment.</returns>
procedure IsEnabled(CopilotCapability: Enum "Copilot Capability"; Silent: Boolean; AppId: Guid): Boolean
var
AppModuleInfo: ModuleInfo;
begin
if not NavApp.GetModuleInfo(AppId, AppModuleInfo) then
exit(false);
exit(AzureOpenAIImpl.IsEnabled(CopilotCapability, Silent, AppModuleInfo));
end;

/// <summary>
/// Checks if the Azure OpenAI API authorization is configured for the environment.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,12 @@ codeunit 7774 "Copilot Capability Impl"
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"System Action Triggers", 'GetCopilotCapabilityStatus', '', false, false)]
local procedure GetCopilotCapabilityStatus(Capability: Integer; var IsEnabled: Boolean)
var
local procedure GetCopilotCapabilityStatus(Capability: Integer; var IsEnabled: Boolean; AppId: Guid; Silent: Boolean)
5a var

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0519 '5' is not valid value in this context.

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0104 Syntax error, '}' expected

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0198 Expected one of the application object keywords (table, tableextension, page, pageextension, pagecustomization, profile, profileextension, codeunit, report, reportextension, xmlport, query, controladdin, dotnet, enum, enumextension, interface, permissionset, permissionsetextension, entitlement)

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0519 '5' is not valid value in this context.

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0104 Syntax error, '}' expected

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0198 Expected one of the application object keywords (table, tableextension, page, pageextension, pagecustomization, profile, profileextension, codeunit, report, reportextension, xmlport, query, controladdin, dotnet, enum, enumextension, interface, permissionset, permissionsetextension, entitlement)

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0519 '5' is not valid value in this context.

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0104 Syntax error, '}' expected

Check failure on line 273 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0198 Expected one of the application object keywords (table, tableextension, page, pageextension, pagecustomization, profile, profileextension, codeunit, report, reportextension, xmlport, query, controladdin, dotnet, enum, enumextension, interface, permissionset, permissionsetextension, entitlement)
AzureOpenAI: Codeunit "Azure OpenAI";

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0114 Syntax error, integer literal expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0104 Syntax error, '{' expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0104 Syntax error, '}' expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0198 Expected one of the application object keywords (table, tableextension, page, pageextension, pagecustomization, profile, profileextension, codeunit, report, reportextension, xmlport, query, controladdin, dotnet, enum, enumextension, interface, permissionset, permissionsetextension, entitlement)

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0114 Syntax error, integer literal expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0104 Syntax error, '{' expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0104 Syntax error, '}' expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0198 Expected one of the application object keywords (table, tableextension, page, pageextension, pagecustomization, profile, profileextension, codeunit, report, reportextension, xmlport, query, controladdin, dotnet, enum, enumextension, interface, permissionset, permissionsetextension, entitlement)

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0114 Syntax error, integer literal expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0104 Syntax error, '{' expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0104 Syntax error, '}' expected

Check failure on line 274 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0198 Expected one of the application object keywords (table, tableextension, page, pageextension, pagecustomization, profile, profileextension, codeunit, report, reportextension, xmlport, query, controladdin, dotnet, enum, enumextension, interface, permissionset, permissionsetextension, entitlement)
CopilotCapability: Enum "Copilot Capability";

Check failure on line 275 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0114 Syntax error, integer literal expected

Check failure on line 275 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0104 Syntax error, '{' expected

Check failure on line 275 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0114 Syntax error, integer literal expected

Check failure on line 275 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0104 Syntax error, '{' expected

Check failure on line 275 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0114 Syntax error, integer literal expected

Check failure on line 275 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0104 Syntax error, '{' expected
Silent: Boolean;
begin

Check failure on line 276 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0104 Syntax error, '}' expected

Check failure on line 276 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0104 Syntax error, '}' expected

Check failure on line 276 in src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0104 Syntax error, '}' expected
CopilotCapability := Enum::"Copilot Capability".FromInteger(Capability);

if CopilotCapability = Enum::"Copilot Capability"::Chat then
Silent := true;

IsEnabled := AzureOpenAI.IsEnabled(CopilotCapability, Silent);
IsEnabled := AzureOpenAI.IsEnabled(CopilotCapability, Silent, AppId);
end;
}

0 comments on commit 01de27c

Please sign in to comment.