Business Central AI Copilots and Azure OpenAI Services
In this post we will look at some things related to the Copilots & Azure Open AI Services available for Business Central for both developers and functionals.
50+ new AI-related features were announced at the latest Microsoft Inspire events.
The AI pillars on which Microsoft focuses are related to these topics (this can also be seen from the photo below presented at the RoadMap).
Generative AI Pillar:
- ChatGPT 4
- Bing AI Expansion
- Copilots (Codex & GPT4)
- Azure Open AI Services
OPEN AI – FOUNDATION MODELS
Business Central 2023 Wave 2 … generative AI pillar!
…also for Business Central it can be seen that generative AI (G) (like ChatGPT) is one of the pillars on which they focus, welcome to generative AI.
Business Central RoadMap (investment Areas)
Why Co-pilot?
Co-pilot : “a pilot who helps the main pilot on an aircraft“ – Cambridge Dictionary
MS: “According to our recent Business Trends Survey, nearly 9 out of 10 workers want to use AI to reduce repetitive tasks in their job. However, until now, few SMEs could actually invest in AI Microsoft Dynamics 365 Copilot empowers professionals to do their day-to-day work with the assistance of cutting-edge artificial intelligence.
With Copilot in Business Central, our customers can give their workers intuitive AI-powered tools to do more work with less effort, without having to become a data scientist.
The first release cycle of 2023 introduces our first Copilot feature – AI-generated product descriptions and adding to our catalog of AI-powered features such as forecasting cash flow and payment delays.”
..but remember that you are the pilot!! . with an AI Copilot!
GitHub Copilot for Development
** GitHub copilot is based on “OpenAI”, Microsoft partner for AI Applications **
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work. It draws context from comments and code to suggest individual lines and whole functions instantly. GitHub Copilot is powered by OpenAI Codex (G), a generative pretrained language model created by OpenAI.
GitHub Copilot is free to use for verified students, teachers, educators and maintainers of popular open source projects.
It is available as an extension for Visual Studio Code, Visual Studio (and other languages), Neovim, and the JetBrains suite of integrated development environments (IDEs).
Great in Visual Studio
In Visual Studio, Copilot acts as a pair-programmer making it more joyous to code – and increases your productivity at the same time.
GitHub Copilot in Visual Studio 2022 – Visual Studio Blog (microsoft.com)
Install GitHub Copilot
Getting started with GitHub Copilot – GitHub Docs
Copilot in VSCode development
Ask to Copilot Chat
Ask Pilot Best Buttons
- Readable 🡪 explode and simplify your code for reading
- Fix Bug 🡪 check your code
- Document 🡪 create an AI documentation
- Custom 🡪 add your functionalities
Test Convert Call Azure Function to CSharp
Obviously this is just a translation test. The system translates the AL syntax into the c or Csharp language by looking for patterns in GitHub, it is certainly useful for making comparisons with other languages or for seeing the proposed patterns (like a Learning Platform).
- Example: Ask Copilot: translate from AL to C language
Find a bug in code
This feature is very useful for checking any bugs in the code; in the tests I did it worked almost always well, obviously the control material for AL is still scarce, with cSharp instead it works great.
- Results: NO Bugs inside this Al code block
Copilot with Dynamics 365 Business Central
Copilot in Dynamics 365 Business Central streamlines the creation of product listings for online commerce. Product attributes such as color, material and size can be used to create compelling product descriptions for online storefronts in seconds.
The descriptions can be further tailored by choosing tone of voice, format and length.
Business Central customers using Shopify can seamlessly publish the products with descriptions to their Shopify store in just a few clicks.
NOTE: Uses Azure Open AI Services (NOT ChatGPT)… but it is still based on a generative service (G) as in ChatGPT
Activate Copilot in Business Central
Search for “Copilot” 🡪 Activate functionality
“Marketing Text” on Item Card example
It is possible to test the Copilot on the item page, click on “marketing text” in the Factbox.
Click on “Create with Copilot” 🡪 select item attributes and other details and send data to AI LMM
How Copilot works:
Final Result: The marketing text!
…mmm… I don’t really like this thing, I understand privacy issues, trademarks etc. but it would be useful to be able to train AI models for certain cases and certain topics (user\customer choice).
Azure OpenAI Service
The Azure OpenAI service provides access to advanced AI generative models, such as GPT-4, Codex, and DALL-E, for tasks such as content generation, summarization, semantic search, and natural language-to-code translation, making it a versatile platform for a wide range of Artificial Intelligence Systems.
Azure OpenAI service offers a wide range of AI models for different applications: from Chatbots to code generation.
Developers can integrate ChatGPT into their applications. ChatGPT can be used for tasks such as summarizing content, providing suggested email copies, and answering software programming questions, helping users code more efficiently.
At the same time, Azure OpenAI ensures private networking, regional availability, and responsible AI content filtering, all backed by the computing power of Microsoft Azure.
What is Azure OpenAI Service? – Azure Cognitive Services | Microsoft Learn
Azure Portal – Azure OpenAI
MS Example for Business Central & OpenAI Services Integration
Aka.ms/BCStartCodingWithAI
AL Code example
“SuggestItemCategory” by Azure OpenAI
- Inkove AzureOpenAi.GenerateCompletion function, based on Codeunit “Azure OpenAi“
local procedure SuggestItemCategory(): Code[20]
var
AzureOpenAi: Codeunit “Azure OpenAi”;
SuggestedCategory: Text;
ItemCategories: Text;
SuggestedCategoryCode: Code[20];
begin
ItemCategories := BuildCategoryList(); // RAI: pre-processing grounding (provide item categories)
//Invoke Azure OpenAi
SuggestedCategory := AzureOpenAi.GenerateCompletion(StrSubstNo(CategoryPromptTxt, Rec.Description, ItemCategories), 1000, 0);
SuggestedCategoryCode := ValidateCategory(SuggestedCategory); // RAI: post-processing grounding (prevent fabrication)
exit(SuggestedCategoryCode);
end;
trigger OnValidate()
var
AzureOpenAi: Codeunit “Azure OpenAi”;
begin
AzureOpenAi.SetEndpoint(Endpoint);
AzureOpenAi.SetSecret(”);
Clear(Secret);
end;