Prompt Engineering with Power Platform

Prompt Engineering with Power Platform

Prompt Engineering

Parts of a prompt:

There are two parts to a prompt for a GPT model, the instruction and the context.

  • The instruction is the first part of the prompt. It should provide clear directions on what the model should do; for example, "Summarize this email in three bullets."
  • The context is the second part of the prompt. It should provide the information the model needs to generate an appropriate response; for example, "The email contains customer feedback from the past week."

Characteristics of a good prompt:

  • Clear and concise: It's written in clear and concise language that's easy to understand.
  • Specific: It's specific enough to guide the GPT model in the right direction.
  • Contextual: It provides enough context for the GPT model to generate meaningful output.
  • Relevant: It's relevant to the task and provides the GPT model with enough information to generate meaningful output.

Power Platform for Prompt Engineering

Text generation is powered by Azure OpenAI Service, which is built on Generative Pre-trained Transformer (GPT) technology.

Overview:

This guide outlines 3 easy steps to create an AI-powered solution tailored for healthcare workers.

Prerequisites:

  • Your power platform environment in Europe.
  • The tenant must be allow-listed while this feature is in private preview.
  • A Power Apps or Power Automate license.
  • Dataverse database installed on the environment.
  • An AI Builder add-on.

1. Create a Prompt:

Sign in to Power Apps. On the left navigation panel, select AI Hub > AI Prompts (Invites) > Crete text using custom prompts

There are many types of prompts to pick from, I used the "Custom task with custom prompts".

Building the prompt:

Context: "I am a nurse at a children's hospital that needs to instructions on how to use this medical instrument:" I added a dynamic value "Medical Instrument" for the user to select (on the PowerApp).

Instruction: "Provide a concise list of instructions to help me use the instrument appropriately. Do not add any additional text."propriately. Do not add any additional text.

I am a nurse at a children's hospital that needs to instructions on how to use this medical instrument: Medical Instrument . Provide a concise list of instructions to help me use the instrument appropriately. Do not add any additional text.        

2. Creating a Dataverse table:

I created a simple Dataverse table to store a list of medical devices used by healthcare workers. We will use this table in our canvas PowerApp.

3. Canvas PowerApp:

  1. Create a blank canvas powerapp, with a simple header.
  2. Add the Dataverse table and your prompt as the datasources
  3. Add a gallery to show all medical devices from the Dataverse table and a text field to show the generated text from the prompt.
  4. Add the following PowerFx formula for the 'OnSelect' property of the gallery:

Set(varInstructions, 'Medical Instrument Instructions'.Predict(ThisItem.'Nom du Dispositif'))        

5. Add a text label on the right half and the 'Text' property set to:

varInstructions.Text        

Demo:

Unmanaged Solution is available to download on GitHub

要查看或添加评论,请登录

社区洞察

其他会员也浏览了