How to integrated ChatGPT in D365 Finance and Operation

 How to integrated chat GPT in D365 Finance and Operation :

create VS solution as per  requirement (chatGpt), on this solution created three project:
1. Lok_chatgpt(class Library {.NET Framework}) 
2. Lok_chatgpt (Finance and Operation)
2. Test (Console Application)

Step1. Install the OpenAI C# SDK:
The first step in integration ChatGPT is to install the OpenAI C# SDK. You can do this using the NuGet package manager by running the following command in the package Manger Console.

Step2. Initialize the SDK:
Once the OpenAI C# SDK is installed, you need to initialize it by providing your OpenAI API key. This can be done by creating an instance of the OpenAIClient class and passing in your API key as a parameter.

Step3. Use ChatGPT:
With the SDK initialized, you can now use ChatGPT to generated text completions. The Completions method of the OpenAIClient class can be used for this purpose. This method takes in several parameter, including the prompt that you want to generate completions for, the model to use (in this case, "text-davinci-003"), and the number of completion generate.

Now below code for .NET Library C# 
 using Open_API  is used in below class and also in this class takes several required parameter, including the prompt  that you want to generated.

Step4. Implement in Finance and Operation Project:
Created two form one is parameter form and other one ChatGPT form. created one class write a logic for pass all parameter in this class  . I have added of C# project DLL in Finance and operation project    


Comments