MADHDA Business Solutions
  • Home
  • About Us
    • Privacy Policy
  • Services
    • Implementations
    • Support
    • Training
    • Upgrade
    • Business Analysis
  • Solutions
    • MS Dynamics 365 Business Central
    • MS Dynamics Nav
    • MS Dynamics 365 Sales/CRM
    • Power BI
    • Power Automation
  • Resources
    • Blog
  • Contact Us
  • Integration of ChatGPT in Business Central.

Integration of ChatGPT in Business Central.

12 April 2023

Integration of ChatGPT in Business Central.

Dear Readers,

 

Hope you are doing well and safe.

So, today we will discuss Integration Between Chat GPT & Business Central.

  • Let’s discuss Chat GPT. So, what is Chat GPT?

 

Chat GPT is a natural language processing tool driven by AI technology that allows you to have human-like conversations and much more with a chatbot. The language model can answer questions, and assist you with tasks such as composing emails, essays, and code. Usage is currently open to the public free of charge because Chat GPT is in its research and feedback-collection phase. As of Feb. 1, there is also a Paid Subscription Version Called Chat GPT Plus.

 

Let’s Integrate Chat GPT with Business Central.

  • First of all create an account for using Chat GPT on Open AI.

You can Register on open AI using below Link.

Register on Open AI.

After filling in All the Details your OPEN AI Account will be created. We need this account to get some Details to access Chat GPT like API KEY & Organization ID.

 

  • Now to get the API KEY click on your Profile and then select View API KEY.

As you can see in below image.

As you can see there Is one Secret Key which is our API KEY.

 

  • To integrate Chat GPT & Business Central. We need Organization ID. For that Click on Setting As you can see in below Image.

 

  • Now let’s create one table for OPEN AI SETUP and add five fields in this Table. As you can see in below image.

  • Also create one card page for that.

 

  • Create one more page to ask Questions and show that’s answer. So, add two fields In two different groups and this page have no source table. As per the below image.

 

   We are using some page properties like:

  1. Delete Allowed
  2. Insert Allowed

         and also use some fields properties like:

  1. Multi-Line
  2. Show Caption.

 

  • Now add one action on this page This action is for send request to Open AI and get a response from Open AI. As you can see in below Image.

 

This variable is for our fields, because we are not using any source table for this page.

  • Create one CODEUNIT contacting with OPEN AI. Now create one This is our main procedure. We are calling many Procedures in this. As you can see in below Image.

  • Now create one Local Procedure for Set Body. This procedure is to Check Inserted Details like our API KEY, Organization ID, Mix Token and temperature.  and If Al provided Details are correct then we get response other wise get error. As you can see in below image.

 

  • Now create one Local Procedure for Set Body. This procedure is for set header and authorize values and store responses. As you can see in below image.

 

  • Now create one Local Procedure for This procedure is to send our request to the Server. Check our Details and if all are correct then request send if find any mistake or issues then give error. As you can see in below Image. As you can see in below Image.

 

  • Now create one Local Procedure for Read Response. This procedure is for read response form server and show us in JSON format. As you can see in below image

 

  • Now create one Local Procedure for Send Default Requests. This procedure get our Details (Like API KEY, Organization ID, Mix Token) form Open AI Set up Page and send Requests to the server. As you can see in below Image.

 

  • Now we are creating some other procedures for show responses in text format, authentication(Checking API KEY), etc. Basically, these procedures are used for checking or assign Data.

 

  • Now, these are some global variables that we are used in this Code unit.

 

We already called this action on our ASK GPT Card Page which can see in Image 8.

  • Now published extension and then OPEN AI SETUP

Insert these all Details in the fields.

  1. Organization ID (Get from OPEN AI App. Image No. 4)
  2. API Key (Get from OPEN AI App. Image No. 3)
  3. Default Max Token (1000)
  4. Default Temperature (0.9)

As you can see in below image.

  • Now open the ASK GPT Card Page and type your Question or Query in the Request Section and then click on SEND. As you can see in below image.

 

  • Now our code unit send request to the server and get a response from the server and show in the Response Section

We passed a request for How to Create Sales Order in Business Central?

and we get this solution in response from the server.

As you can see in below Image.

 

If any mistake or wrong details provided, then server  throws an error in JSON format.

Stay connected with us to learn more topics like this!

 For more details, pls visit our website www.madhda.com or contact us on Contact@madhda.com

 

Thanks to all.

Madhda

Previous post: Integration Between Dataverse And Dynamics 365 Business Central.
Next post: Configure Business Central Container in Docker.

Categories

  • Microsoft Dynamics 365
  • Microsoft Dynamics Business central
  • Microsoft Dynamics NAV
  • Uncategorized

Recent Post

  • Configure Business Central Container in Docker.
    April 27, 2023
  • Integration of ChatGPT in Business Central.
    April 12, 2023
  • Integration Between Dataverse And Dynamics 365 Business Central.
    April 3, 2023
  • Business Central : Retrieving Azure AD User information via AL.
    March 20, 2023
  • Change Authentication method from Basic Auth to OAuth2 while accessing Business Central Webservice / APIs.
    February 27, 2023
 

    © Copyright 2020 | All Rights Reserved By MADHDA