How to Use Azure Prompt Engineering APS in Bot Composer

How to Use Azure Prompt Engineering APS in Bot Composer

In this article, we will discuss how to use Azure Prompt Engineering APS in Bot Composer. Azure SDK provides two APAs for chat completion API and completion API. Each AP requires input data to be formatted differently. In this article, we will focus on the completion API.

The completion API supports older GPT3 models. To use the completion API, you need to pass the input as a string of text and then you will receive the response.

We will not go into detail about the completion API in this article, as we will cover the prompt engineering concept separately. Our main focus here is how to use this API in Bot Composer.

To implement this feature in Bot Composer, you first need to watch a video on how to create a resource and use it in Bot Framework. Once you have created the project in Visual Studio, make sure to change the target framework to 7.0.

Next, go to the package manager and search for ‘Azure AI’. Install the package ‘Azure.AI.Language.Generation.Prompt’.

After installing the package, go to the composer back and select the ‘Prompt Completion’ option. Configure the prompt endpoint, API key, and deployment name.

To configure the prompt, go to ‘Properties’ and manage the property. Set the property as ‘dialog.prompt’ and configure the value field in JSON format.

Once the prompt is added, you can see the settings option available. Configure the prompt endpoint API key and deployment name.

To invoke the unknown intent, go to ‘Add Node’ and select the ‘Unknown Intent’. Add a prompt and configure the prompts you want to send.

In the ‘Send Response’ section, you can print the complete result using ’turn.result’.

Start the bot and open the web chat to connect to the bot. Send a message and you will receive a response from the OpenAI prompt.

In the response, you can check the success property to see if the prompt was successful. You can also check the result property to see the choices and their corresponding values.

That’s it! Now you know how to use Azure Prompt Engineering APS in Bot Composer.

Five Unique Ways to Generate Side Income with 4 GB
Older post

Five Unique Ways to Generate Side Income with 4 GB

Newer post

The Enchanting Adventure of Remy the Rabbit

The Enchanting Adventure of Remy the Rabbit