Como escrever um bom prompt

O Co-Pilot para automatizadores permite explorar diferentes variações de um prompt para determinar qual é a melhor opção para você. Se os resultados iniciais não atenderem às necessidades, é possível desfazer ou excluir a automação, reformular o prompt e executá-lo novamente.

Siga estes princípios para obter resultados melhores e mais relevantes do Automation Co-Pilot.

Escreva instruções inequívocas

O Automation Co-Pilot tem como objetivo entender sua intenção com base na instrução (ou prompt) enviada. Fornecer instruções claras e específicas reduz as suposições e produz melhores resultados.

Quando instruído com Send Email no Editor de bot, o Automation Co-Pilot usa o Pacote de comandos de e-mail para executar esse prompt. Se a intenção era enviar um e-mail com o Microsoft 365 Outlook, então o prompt correto seria a ação Send Outlook email.

Vá direto ao ponto

Forneça instruções diretas e evite pedir ou “pensar em voz alta”.

Em vez de can you please help me to create an automation to send email (você pode me ajudar a criar uma automação para enviar e-mail?), reformule a solicitação como create an automation to send email to demo@demo.com with subject 'this is a demo' (crie uma automação para enviar e-mail para demo@demo.com com o assunto 'isto é uma demonstração').

Divida ações complexas

Se o cenário de automação envolver múltiplas etapas, divida-as em tarefas menores e mais gerenciáveis.

Em vez de Insert salesforce records into database and check record for email info to send email (Insira registros do Salesforce no banco de dados e verifique o registro de informações de e-mail para enviar e-mail), reformule a solicitação como Get records from Salesforce. For each record, insert it into the database. If the record contains an email address, send an email to demo@demo.com. If not, add a comment. If an error occurs when the bot performs these operations then show a message box. (Obtenha registros do Salesforce. Para cada registro, insira no banco de dados. Se o registro contiver um endereço de e-mail, envie um e-mail para demo@demo.com. Caso contrário, adicione um comentário. Se ocorrer um erro quando o bot realizar essas operações, mostre uma caixa de mensagem).

Adicione contexto adicional sempre que possível

Especificar o tipo de tarefa ou ação no prompt identificará com precisão a etapa da automação.

Usar um prompt para dizer Open excel C:/temp/MyFile.xlsx garantiria que o Automation Co-Pilot use a Ação Excel para abrir o arquivo especificado.

Exemplos de prompts

Estes são exemplos de padrões comuns observados em automações criadas por desenvolvedores. Embora esses padrões de prompt criem saídas ideais, recomendamos ajustá-los conforme as necessidades da automação que você está construindo.

Exemplos de Editor de bot:
  • Open a folder. Loop through each file. Copy the file names and add it in a excel file
  • connect to database using myname/mytoken account
  • open browser google.com
  • create a bot that sends email to $EmailTo$, CC $EmailCC$, from $EmailFrom$, subject 'Bot Started', message 'The bot has now started'
  • run excel macro "TestMacro" on C:\Temp\MacroFile.xls. Then switch to excel Main worksheet and get all cells
  • Prompt for the user to select the folderpath. Loop through the selected folder including subfolders. If any excel file is found, then check for the worksheet ‘Main’. if available save it as a PDF in the same folder
  • get records from salesforce. for each salesforce record, insert a record into the database. if the record contains an email, send an email. if not, add a comment. if an error occurs when the bot performs these operations show a message box
  • Sharepoint Operations:
    • authenticate sharepoint with Client ID as $ClientID$, Client Secret as $ClientSecret$, Tenant ID as $TenantID$
    • create sharepoint folder COPILOT at /SiteName/Folders/FA
    • upload file to sharepoint
  • * If / ElseIf / Else:
    • If response is A, connect to database and read data. Else, send email to $EmailTo$
    • If response is A, connect to database and read data. Else if response is B, open www.google.com. Else, send email to $EmailTo$
  • Error Handler:
    • open excel C:\temp.xlsx. When error occurs, send an email
    • open excel C:\temp.xlsx. When error occurs, send an email to me@myorg.com
    • open excel C:\temp.xlsx and get all rows. If error occurs when performing these operations, send an email
    • add try-catch
    • add error handler
  • Use Excel Advanced package to load the data from 'SalesData.xlsx' located in the 'C:\Reports' folder. Write this data into XYZ oracle database.
  • Prompt user for two folders. Loop first folder to find excel files and copy them to second folder.
  • Create a bot to copy data from a table in database to excel.

Exemplos de Compositor de processos:
  • Create a new customer profile in the CRM system. The name, email address, and phone number will be provided by a user via a form.
  • Read the list of automotive parts from a pdf using a document automation task, use a bot to search these parts in a website, and email the collected information
  • Start with a form to enter patient information. Then filter out patients that are 75 years old and older. Finally, add a bot to save the information in an excel spreadsheet.
  • Get data from an invoice. If the name starts with "new", check the price. If the price is above 1000, send an email and If the price is below 500, then go to the first task. Otherwise, save the data to Excel file. If the invoice doesn't start with new, validate the document.
  • Add a form task for EntryForm.
  • Add a bot task for botInput.