From 99b7d929fd06fae2c3e04f9cc370a11ceb2236ad Mon Sep 17 00:00:00 2001 From: Darrick Date: Wed, 18 Jun 2025 15:16:03 +0200 Subject: [PATCH 1/5] Merge 2d0c85eca5a4e65f0ca0b7296fd360c642c810e9 into 9906bf7880c728b6b780943db2ada096c7475521 --- .../Azure OpenAI/AOAIDeployments.Codeunit.al | 55 ++++++++++++++++++- .../AOAIDeploymentsImpl.Codeunit.al | 29 +++++++++- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/src/System Application/App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al b/src/System Application/App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al index 6702edaf20..998ad55508 100644 --- a/src/System Application/App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al +++ b/src/System Application/App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al @@ -108,11 +108,12 @@ codeunit 7768 "AOAI Deployments" exit(AOAIDeploymentsImpl.GetGPT4Preview(CallerModuleInfo)); end; #endif - +#if not CLEAN27 /// /// Returns the name of the latest AOAI deployment model of GPT4o. /// /// The deployment name. + [Obsolete('GPT4o deployment name is no longer supported. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] procedure GetGPT4oLatest(): Text var CallerModuleInfo: ModuleInfo; @@ -125,6 +126,7 @@ codeunit 7768 "AOAI Deployments" /// Returns the name of preview AOAI deployment model of GPT4o. /// /// The deployment name. + [Obsolete('GPT4o deployment name is no longer supported. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] procedure GetGPT4oPreview(): Text var CallerModuleInfo: ModuleInfo; @@ -137,6 +139,7 @@ codeunit 7768 "AOAI Deployments" /// Returns the name of the latest AOAI deployment model of GPT4o-Mini. /// /// The deployment name. + [Obsolete('GPT4o mini deployment name is no longer supported. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] procedure GetGPT4oMiniLatest(): Text var CallerModuleInfo: ModuleInfo; @@ -149,6 +152,7 @@ codeunit 7768 "AOAI Deployments" /// Returns the name of preview AOAI deployment model of GPT4o-Mini. /// /// The deployment name. + [Obsolete('GPT4o mini deployment name is no longer supported. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] procedure GetGPT4oMiniPreview(): Text var CallerModuleInfo: ModuleInfo; @@ -156,4 +160,53 @@ codeunit 7768 "AOAI Deployments" NavApp.GetCallerModuleInfo(CallerModuleInfo); exit(AOAIDeploymentsImpl.GetGPT4oMiniPreview(CallerModuleInfo)); end; +#endif + + /// + /// Returns the name of the latest AOAI deployment model of GPT-4.1. + /// + /// The deployment name. + procedure GetGPT41Latest(): Text + var + CallerModuleInfo: ModuleInfo; + begin + NavApp.GetCallerModuleInfo(CallerModuleInfo); + exit(AOAIDeploymentsImpl.GetGPT41Latest(CallerModuleInfo)); + end; + + /// + /// Returns the name of the preview AOAI deployment model of GPT-4.1. + /// + /// The deployment name. + procedure GetGPT41Preview(): Text + var + CallerModuleInfo: ModuleInfo; + begin + NavApp.GetCallerModuleInfo(CallerModuleInfo); + exit(AOAIDeploymentsImpl.GetGPT41Preview(CallerModuleInfo)); + end; + + /// + /// Returns the name of the latest AOAI deployment model of GPT-4.1 mini. + /// + /// The deployment name. + procedure GetGPT41MiniLatest(): Text + var + CallerModuleInfo: ModuleInfo; + begin + NavApp.GetCallerModuleInfo(CallerModuleInfo); + exit(AOAIDeploymentsImpl.GetGPT41MiniLatest(CallerModuleInfo)); + end; + + /// + /// Returns the name of the preview AOAI deployment model of GPT-4.1 mini. + /// + /// The deployment name. + procedure GetGPT41MiniPreview(): Text + var + CallerModuleInfo: ModuleInfo; + begin + NavApp.GetCallerModuleInfo(CallerModuleInfo); + exit(AOAIDeploymentsImpl.GetGPT41MiniPreview(CallerModuleInfo)); + end; } \ No newline at end of file diff --git a/src/System Application/App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al b/src/System Application/App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al index 57ba137d38..0db94210b4 100644 --- a/src/System Application/App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al +++ b/src/System Application/App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al @@ -17,10 +17,16 @@ codeunit 7769 "AOAI Deployments Impl" var Telemetry: Codeunit Telemetry; +#if not CLEAN27 GPT4oLatestLbl: Label 'gpt-4o-latest', Locked = true; GPT4oPreviewLbl: Label 'gpt-4o-preview', Locked = true; GPT4oMiniLatestLbl: Label 'gpt-4o-mini-latest', Locked = true; GPT4oMiniPreviewLbl: Label 'gpt-4o-mini-preview', Locked = true; +#endif + GPT41LatestLbl: Label 'gpt-41-latest', Locked = true; + GPT41PreviewLbl: Label 'gpt-41-preview', Locked = true; + GPT41MiniLatestLbl: Label 'gpt-41-mini-latest', Locked = true; + GPT41MiniPreviewLbl: Label 'gpt-41-mini-preview', Locked = true; DeprecatedDeployments: Dictionary of [Text, Date]; DeprecationDatesInitialized: Boolean; DeprecationMessageLbl: Label 'We detected usage of the Azure OpenAI deployment "%1". This model is obsoleted starting %2 and the quality of your results might vary after that date. Check out codeunit 7768 AOAI Deployments to find the supported deployments.', Comment = 'Telemetry message where %1 is the name of the deployment and %2 is the date of deprecation'; @@ -86,7 +92,7 @@ codeunit 7769 "AOAI Deployments Impl" exit(GetDeploymentName(GPT4LatestLbl)); end; #endif - +#if not CLEAN27 procedure GetGPT4oPreview(CallerModuleInfo: ModuleInfo): Text begin exit(GetDeploymentName(GPT4oPreviewLbl)); @@ -106,6 +112,27 @@ codeunit 7769 "AOAI Deployments Impl" begin exit(GetDeploymentName(GPT4oMiniLatestLbl)); end; +#endif + + procedure GetGPT41Preview(CallerModuleInfo: ModuleInfo): Text + begin + exit(GetDeploymentName(GPT41PreviewLbl)); + end; + + procedure GetGPT41Latest(CallerModuleInfo: ModuleInfo): Text + begin + exit(GetDeploymentName(GPT41LatestLbl)); + end; + + procedure GetGPT41MiniPreview(CallerModuleInfo: ModuleInfo): Text + begin + exit(GetDeploymentName(GPT41MiniPreviewLbl)); + end; + + procedure GetGPT41MiniLatest(CallerModuleInfo: ModuleInfo): Text + begin + exit(GetDeploymentName(GPT41MiniLatestLbl)); + end; // Initializes dictionary of deprecated models local procedure InitializeDeploymentDeprecationDates() From af610c7681b04a65111dac6a6e42ac67d03137ef Mon Sep 17 00:00:00 2001 From: Darrick Joo Date: Wed, 18 Jun 2025 15:56:58 +0200 Subject: [PATCH 2/5] Update EntityText --- .../App/Entity Text/src/EntityTextImpl.Codeunit.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System Application/App/Entity Text/src/EntityTextImpl.Codeunit.al b/src/System Application/App/Entity Text/src/EntityTextImpl.Codeunit.al index ff6bc0d783..233f57b4d4 100644 --- a/src/System Application/App/Entity Text/src/EntityTextImpl.Codeunit.al +++ b/src/System Application/App/Entity Text/src/EntityTextImpl.Codeunit.al @@ -343,7 +343,7 @@ codeunit 2012 "Entity Text Impl." AzureOpenAI.SetAuthorization(Enum::"AOAI Model Type"::"Chat Completions", Endpoint, Deployment, ApiKey) else if (not IsNullGuid(CallerModuleInfo.Id())) and (CallerModuleInfo.Publisher() = EntityTextModuleInfo.Publisher()) then - AzureOpenAI.SetAuthorization(Enum::"AOAI Model Type"::"Chat Completions", AOAIDeployments.GetGPT4oLatest()) + AzureOpenAI.SetAuthorization(Enum::"AOAI Model Type"::"Chat Completions", AOAIDeployments.GetGPT41Latest()) else begin TelemetryCD.Add('CallerModuleInfo', Format(CallerModuleInfo.Publisher())); TelemetryCD.Add('EntityTextModuleInfo', Format(EntityTextModuleInfo.Publisher())); From 8d3e0158c9d7ab2d093ff5cfb5cc9ec9722ab5af Mon Sep 17 00:00:00 2001 From: Darrick Joo Date: Wed, 18 Jun 2025 15:58:30 +0200 Subject: [PATCH 3/5] Update obsolete message --- .../App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/System Application/App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al b/src/System Application/App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al index 998ad55508..6a8669354e 100644 --- a/src/System Application/App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al +++ b/src/System Application/App/AI/src/Azure OpenAI/AOAIDeployments.Codeunit.al @@ -113,7 +113,7 @@ codeunit 7768 "AOAI Deployments" /// Returns the name of the latest AOAI deployment model of GPT4o. /// /// The deployment name. - [Obsolete('GPT4o deployment name is no longer supported. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] + [Obsolete('GPT4o deployment name is no longer supported from 15 July 2025. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] procedure GetGPT4oLatest(): Text var CallerModuleInfo: ModuleInfo; @@ -126,7 +126,7 @@ codeunit 7768 "AOAI Deployments" /// Returns the name of preview AOAI deployment model of GPT4o. /// /// The deployment name. - [Obsolete('GPT4o deployment name is no longer supported. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] + [Obsolete('GPT4o deployment name is no longer supported from 15 July 2025. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] procedure GetGPT4oPreview(): Text var CallerModuleInfo: ModuleInfo; @@ -139,7 +139,7 @@ codeunit 7768 "AOAI Deployments" /// Returns the name of the latest AOAI deployment model of GPT4o-Mini. /// /// The deployment name. - [Obsolete('GPT4o mini deployment name is no longer supported. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] + [Obsolete('GPT4o mini deployment name is no longer supported from 15 July 2025. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] procedure GetGPT4oMiniLatest(): Text var CallerModuleInfo: ModuleInfo; @@ -152,7 +152,7 @@ codeunit 7768 "AOAI Deployments" /// Returns the name of preview AOAI deployment model of GPT4o-Mini. /// /// The deployment name. - [Obsolete('GPT4o mini deployment name is no longer supported. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] + [Obsolete('GPT4o mini deployment name is no longer supported from 15 July 2025. Use GetGPT41Latest instead (or GetGPT41Preview for testing upcoming versions).', '27.0')] procedure GetGPT4oMiniPreview(): Text var CallerModuleInfo: ModuleInfo; From 8ee2ab1f8fbeb07c539c92007c1b449ed192be49 Mon Sep 17 00:00:00 2001 From: Darrick Joo Date: Wed, 18 Jun 2025 16:05:01 +0200 Subject: [PATCH 4/5] Add deprecated deployments list with dates --- .../App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/System Application/App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al b/src/System Application/App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al index 0db94210b4..d95c05cf1e 100644 --- a/src/System Application/App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al +++ b/src/System Application/App/AI/src/Azure OpenAI/AOAIDeploymentsImpl.Codeunit.al @@ -149,6 +149,12 @@ codeunit 7769 "AOAI Deployments Impl" DeprecatedDeployments.Add(Turbo0301SaasLbl, DMY2Date(1, 11, 2024)); DeprecatedDeployments.Add(GPT40613SaasLbl, DMY2Date(1, 11, 2024)); DeprecatedDeployments.Add(Turbo0613SaasLbl, DMY2Date(1, 11, 2024)); +#endif +#if not CLEAN27 + DeprecatedDeployments.Add(GPT4oLatestLbl, DMY2Date(15, 7, 2025)); + DeprecatedDeployments.Add(GPT4oPreviewLbl, DMY2Date(15, 7, 2025)); + DeprecatedDeployments.Add(GPT4oMiniLatestLbl, DMY2Date(15, 7, 2025)); + DeprecatedDeployments.Add(GPT4oMiniPreviewLbl, DMY2Date(15, 7, 2025)); #endif DeprecationDatesInitialized := true; end; From 26f4c7e54485db5346fbdc22464bff408c873366 Mon Sep 17 00:00:00 2001 From: Darrick Joo Date: Thu, 19 Jun 2025 10:06:13 +0200 Subject: [PATCH 5/5] update no series to gpt41 --- .../NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al index ac3c7f55fc..e99311757f 100644 --- a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al +++ b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al @@ -173,7 +173,7 @@ codeunit 324 "No. Series Copilot Impl." if not AzureOpenAI.IsEnabled(Enum::"Copilot Capability"::"No. Series Copilot") then exit; - AzureOpenAI.SetAuthorization(Enum::"AOAI Model Type"::"Chat Completions", AOAIDeployments.GetGPT4oLatest()); + AzureOpenAI.SetAuthorization(Enum::"AOAI Model Type"::"Chat Completions", AOAIDeployments.GetGPT41Latest()); AzureOpenAI.SetCopilotCapability(Enum::"Copilot Capability"::"No. Series Copilot"); AOAIChatCompletionParams.SetMaxTokens(MaxOutputTokens()); AOAIChatCompletionParams.SetTemperature(0);