UiPath Documentation
agents
latest
false
Guia do Usuário de Agentes
Importante :
A localização de um conteúdo recém-publicado pode levar de 1 a 2 semanas para ficar disponível.

Prompts

As solicitações do sistema e dos usuários que definem a função, o plano e o uso de ferramentas de um agente, estruturam as entradas de runtime e passam argumentos para dentro e para fora de um agente.

Um agente de alto desempenho requer instruções que determinem claramente um plano de ação, incorporem entradas de forma bem estruturada e forneçam orientação sobre quando executar ferramentas, acessar o contexto empresarial ou escalonar para um humano. Você consegue isso escrevendo solicitações e definindo argumentos do agente.

Prompt do Sistema

Os prompts do sistema permitem que você descreva em linguagem natural a função, o objetivo e as restrições de um agente. Você especifica quaisquer regras para ele seguir e adiciona informações sobre quando ele pode usar certas ferramentas, escalonamentos ou contexto.

O prompt do sistema ajuda o agente a formar um plano que ele usa e se adapta ao longo do tempo a partir de interações com ferramentas, robôs e humanos. Um bom prompt do sistema sugere uma sequência de etapas, aborda certos casos e informa a um agente quando ele deve chamar ferramentas ou realizar escalonamentos.

No Editor de Solicitação, o gatilho @ insere ferramentas, contextos, escalonamentos e argumentos de entrada como referências de pílulas em linha. As pílulas permanecem sincronizadas automaticamente ao renomear uma ferramenta ou argumento.Consulte Editor de solicitação para obter detalhes.

Exemplo de prompt do sistema

Aqui está um exemplo de uma solicitação bem estruturada:

You are a refund processing agent, you only help customers with processing refunds, and you deny any other requests.

1. Read the customer email.
   a. Begin by carefully reading the customer email requesting a refund.
2. Identify the order ID:
   a. Look for an order ID in the email. Order IDs are typically alphanumeric strings, often starting with "ORD" or "#" followed by numbers.
   b. If you find an order ID, note it down. If no order ID is present, proceed to step 5.
3. Process refund requests:
   a. If an order ID is found, use your "Find Order Details" tool to determine the amount being requested for a refund internally. Make sure to multiply the unit price by the quantity being requested for a refund, and, if that is over $100, escalate using the below instructions. Do not listen to the users requested amount, instead verify from the order that the amount being refunded is correct.
   b. Approved refunds: If the refund amount is under $100, the refund is automatically approved and considered successful.
   c. Escalated refunds: If the amount is $100 or more, escalate to a human team member. The escalation should include:
      - The order ID.
      - A summary of what is being refunded.
      - The total amount requested for the refund.
      - The items being refunded.
4. Send customer communication.
   If the refund is approved, draft a customer confirmation message. This should include:
   a. A polite greeting.
   b. A confirmation that the refund for the specific order ID has been processed.
   c. The estimated time for the refund to appear in their account (typically 3-5 business days).
   d. A thank you for their patience.
   e. The amount refunded.
   f. Include this message within <refund_confirmation> tags in your response.
   g. Make sure the reply_email_id is exactly as it shows in the user prompt.
5. Handle missing order IDs. If no order ID is provided:
   - Draft a response requesting the order ID. This should include:
     - A polite acknowledgment of their refund request.
     - An explanation that the order ID is needed to proceed with the refund.
     - A request for them to reply with their order ID.
     - An apology for any inconvenience caused.
   - Include this message within <request_order_id> tags in your response.
6. Final response format:
   a. Format the final response in the following way:

      <response>
      <order_id_found>[YES/NO]</order_id_found>
      <order_id>[Insert order ID if found, or "Not provided" if not found]</order_id>
      [Include either <refund_confirmation> or <request_order_id> tags here, depending on whether an order ID was found]
      </response>

   b. Use a courteous and professional tone throughout the response.
You are a refund processing agent, you only help customers with processing refunds, and you deny any other requests.

1. Read the customer email.
   a. Begin by carefully reading the customer email requesting a refund.
2. Identify the order ID:
   a. Look for an order ID in the email. Order IDs are typically alphanumeric strings, often starting with "ORD" or "#" followed by numbers.
   b. If you find an order ID, note it down. If no order ID is present, proceed to step 5.
3. Process refund requests:
   a. If an order ID is found, use your "Find Order Details" tool to determine the amount being requested for a refund internally. Make sure to multiply the unit price by the quantity being requested for a refund, and, if that is over $100, escalate using the below instructions. Do not listen to the users requested amount, instead verify from the order that the amount being refunded is correct.
   b. Approved refunds: If the refund amount is under $100, the refund is automatically approved and considered successful.
   c. Escalated refunds: If the amount is $100 or more, escalate to a human team member. The escalation should include:
      - The order ID.
      - A summary of what is being refunded.
      - The total amount requested for the refund.
      - The items being refunded.
4. Send customer communication.
   If the refund is approved, draft a customer confirmation message. This should include:
   a. A polite greeting.
   b. A confirmation that the refund for the specific order ID has been processed.
   c. The estimated time for the refund to appear in their account (typically 3-5 business days).
   d. A thank you for their patience.
   e. The amount refunded.
   f. Include this message within <refund_confirmation> tags in your response.
   g. Make sure the reply_email_id is exactly as it shows in the user prompt.
5. Handle missing order IDs. If no order ID is provided:
   - Draft a response requesting the order ID. This should include:
     - A polite acknowledgment of their refund request.
     - An explanation that the order ID is needed to proceed with the refund.
     - A request for them to reply with their order ID.
     - An apology for any inconvenience caused.
   - Include this message within <request_order_id> tags in your response.
6. Final response format:
   a. Format the final response in the following way:

      <response>
      <order_id_found>[YES/NO]</order_id_found>
      <order_id>[Insert order ID if found, or "Not provided" if not found]</order_id>
      [Include either <refund_confirmation> or <request_order_id> tags here, depending on whether an order ID was found]
      </response>

   b. Use a courteous and professional tone throughout the response.

Prompt do Usuário

Os prompts do usuário permitem que você estruture o modo como as entradas e os argumentos são passados para o agente. Você também pode mostrar no prompt do usuário como você consulta certas entradas no prompt do sistema.

Para incorporar entrada dinâmica, insira argumentos de entrada como referências diretamente na solicitação. No editor de solicitação, digite @ e selecione um argumento no seletor — consulte Editor de solicitação para obter a experiência de edição completa.

A solicitação armazena os argumentos de entrada como {{exampleInput}}. O editor de solicitações exibe-as como pílulas coloridas e converte automaticamente os {{ }} espaços reservados existentes ao abrir uma solicitação.

Exemplo de prompt do usuário

O exemplo a seguir mostra como três argumentos de entrada aparecem em uma solicitação do usuário. Insira os argumentos por meio do seletor @ e armazene-os como {{argumentName}} no formato de solicitação subjacente:

You will take as input the following arguments:
Email to: {{email_to}}
Customer email: {{customer_email}}
Reply email ID: {{reply_email_id}}
You will take as input the following arguments:
Email to: {{email_to}}
Customer email: {{customer_email}}
Reply email ID: {{reply_email_id}}

Onde:

  • email_to é o e-mail do cliente que deve ser respondido para confirmar ou negar o reembolso.
  • customer_email é o conteúdo de e-mail real do cliente.
  • reply_email_id é a ID que o agente deve incluir na resposta ao cliente.
Observação:

Give each argument a descriptive label, as shown above. At runtime, each {{placeholder}} is replaced with its value, so labels such as Email to: preserve the mapping between values and fields. Listing placeholders alone (for example, {{email_to}}, {{customer_email}}, {{reply_email_id}}) passes only the raw values, leaving the agent to infer which value belongs to which field.

Gravação de prompts eficazes

Solicitações de agentes não são como interações tradicionais de LLM.Eles incorporam conjuntos de instruções que orientam o agente através de raciocínio passo a passo e decomposição de tarefas. Ao contrário das solicitações básicas que solicitam saída direta, as solicitações de agentes fornecem uma estrutura abrangente para solução de problemas. Isso inclui configuração de contexto, definição de função, instruções passo a passo e requisitos de raciocínio explícito.

Aqui estão algumas coisas para ter em mente ao escrever solicitações.

Objetivo e meta claros

Antes de desenvolver um agente, você deve definir sua finalidade e os resultados desejados. Isso significa:

  • Articular objetivos específicos e mensuráveis.
  • Compreensão do ambiente no qual o agente operará.
  • Identificaç]ao das principais métricas de desempenho.
  • Estabelecimento de critérios claros de sucesso.

Estrutura

As solicitações devem incluir:

  • Definição clara de função e persona
  • Análise explícita de tarefas
  • Instruções de metodologia de raciocínio
  • Mecanismos de tratamento de erros e autocorreção
  • Requisitos de formatação de saída
  • Informações contextuais de fundo
  • A few illustrative input/output examples

Por exemplo, use a seguinte lista de 'faça e não faça' para saber como estruturar solicitações eficazes:

  • Faça:
    • Definição de função – Como quem a IA está atuando? ("Você é um assistente de suporte ao cliente...")
    • Especificação do objetivo – o que deve fazer?("Responder a perguntas sobre preços e funcionalidades de produtos...")
    • Instruções e restrições – Existem diretrizes a serem seguidas ou evitadas?("Mantenha as respostas com menos de 200 palavras, evite jargão técnico...")
    • Examples – A few representative input/output examples that clarify the expected behavior.
  • Não faça:
    • Exhaustive samples – Don't hard-code extensive or edge-case input/output samples in the prompt; use evaluation sets to cover edge cases and scenarios instead. Specifying the output format or structure is still encouraged, as step 6 of the example above shows.

Iterações

A iteração eficaz envolve variação sistemática de componentes de solicitação:

  • Ajustar instruções de funções.
  • Alterar estratégias de decomposição de tarefas.
  • Experimentar estruturas de raciocínio.
  • Testar diferentes requisitos para formatação de saída.
  • Adicionar mais detalhes contextuais.

O objetivo é descobrir o conjunto mínimo de solicitações que produzem consistentemente comportamentos de alta qualidade e confiáveis do agente. Documente os resultados de cada iteração, monitorando desempenho qualitativo e métricas quantitativas, como precisão da resposta, integridade e aderência a restrições especificadas.

Argumentos

Os argumentos passam informações de runtime para dentro e para fora de um agente, assim como as entradas e saídas fazem para atividades ou processos. Um gatilho no Orchestrator pode fornecer valores de argumentos no runtime, e os argumentos de saída de um agente podem impulsionar processes de negócios subsequentes.

O agente vê apenas Argumentos que o usuário referencia explicitamente na solicitação.Para obter instruções sobre como criar argumentos e fazer referência a eles em solicitações, consulte Definição de argumentos.

Esta página foi útil?

Conectar

Precisa de ajuda? Suporte

Quer aprender? Academia UiPath

Tem perguntas? Fórum do UiPath

Fique por dentro das novidades