UiPath Documentation
agents
latest
false
Guía del usuario de Agents
Importante :
La localización de contenidos recién publicados puede tardar entre una y dos semanas en estar disponible.

Solicitudes

Las solicitudes del sistema y del usuario que definen el rol, el plan y el uso de herramientas de un agente, estructuran las entradas de runtime y pasan argumentos a y desde un agente.

Un agente de alto rendimiento requiere instrucciones que definan claramente un plan de acción, incorporen entradas de forma bien estructurada y den orientación sobre cuándo ejecutar herramientas, acceder al contexto empresarial o escalar a un humano. Para lograrlo, escribe solicitudes y define argumentos del agente.

Solicitud del sistema

Las solicitudes del sistema te permiten describir en lenguaje natural el rol, el objetivo y las restricciones de un agente. Especifica las reglas que debe seguir y añade información sobre cuándo puede utilizar ciertas herramientas, escaladas o contexto.

La solicitud del sistema ayuda al agente a formar un plan que utiliza y que se adapta con el tiempo a partir de las interacciones con herramientas, robots y humanos. Una buena solicitud del sistema sugiere una secuencia de pasos, aborda ciertos casos y le dice al agente cuándo debe llamar a herramientas o elevar escaladas.

En el Editor de solicitudes, el desencadenador @ inserta herramientas, contextos, escaladas y argumentos de entrada como referencias de píldoras en línea. Las píldoras se mantienen sincronizadas automáticamente cuando se cambia el nombre de una herramienta o argumento. Consulta el Editor de solicitudes para obtener más detalles.

Ejemplo de solicitud del sistema

Aquí tienes un ejemplo de solicitud bien estructurada:

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.

Solicitud de usuario

Las solicitudes de usuario te permiten estructurar cómo se pasan las entradas y los argumentos al agente.También puedes mostrar en la solicitud del usuario cómo se hace referencia a ciertas entradas en la solicitud del sistema.

Para incorporar entradas dinámicas, inserta argumentos de entrada como referencias directamente en la solicitud. En el editor de solicitudes, escribe @ y selecciona un argumento del selector y, por último, consulta Editor de solicitudes para tener la experiencia de edición completa.

Los argumentos de entrada se almacenan en la solicitud como {{exampleInput}}. El editor de solicitudes los muestra como píldoras con códigos de colores y convierte los marcadores de posición {{ }} existentes automáticamente cuando se abre una solicitud.

Ejemplo de solicitud de usuario

El siguiente ejemplo muestra cómo aparecen tres argumentos de entrada en una solicitud del usuario. Los argumentos se insertan a través del selector @ y se almacenan como {{argumentName}}en el formato de solicitud subyacente:

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}}

Donde:

  • email_to es el correo electrónico del cliente al que el mensaje debe responder para confirmar o denegar el reembolso.
  • customer_email es el contenido real del correo electrónico del cliente.
  • reply_email_id es el ID que el agente debe incluir en la respuesta al cliente.
Nota:

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.

Escribir solicitudes efectivas

Las solicitudes agénticas no se parecen a las interacciones tradicionales de LLM. Incorporan conjuntos de instrucciones que guían al agente a través del razonamiento en múltiples pasos y la descomposición de tareas.A diferencia de las solicitudes básicas que piden salida directa, las solicitudes agenciales ofrecen un marco completo para la resolución de problemas. Esto incluye la configuración del contexto, la definición del rol, las instrucciones paso a paso y los requisitos de razonamiento explícito.

He aquí algunas cosas a tener en cuenta al escribir solicitudes.

Claro objetivo y propósito.

Antes de desarrollar un agente, debes definir su propósito y los resultados deseados. Esto significa:

  • Articular objetivos específicos y medibles.
  • Comprender el entorno en el que operará el agente.
  • Identificar métricas clave de rendimiento.
  • Establecer criterios de éxito claros.

Estructura

Las solicitudes deben incluir:

  • Definición clara de rol y persona.
  • Desglose explícito de tareas
  • Instrucciones metodológicas de razonamiento
  • Mecanismos de gestión de errores y autocorrección
  • Requisitos de formato de salida
  • Información contextual
  • A few illustrative input/output examples

Por ejemplo, utiliza la siguiente lista de recomendaciones y advertencias para aprender cómo estructurar solicitudes efectivas:

  • Qué hacer:
    • Definición del rol: ¿Cuál es el rol de la IA? ("Eres un asistente de atención al cliente...")
    • Especificación del objetivo: ¿Qué debería hacer? ("Responder a preguntas sobre los precios y las características del producto...")
    • Instrucciones y limitaciones: ¿Qué hacer y no hacer?("Mantener las respuestas por debajo de 200 palabras, evitar jerga técnica...")
    • Examples – A few representative input/output examples that clarify the expected behavior.
  • Qué no hacer:
    • 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.

Iteraciones

La iteración efectiva implica variación sistemática de los componentes de la solicitud:

  • Ajusta las instrucciones del rol.
  • Modifica las estrategias de descomposición de tareas.
  • Experimenta con marcos de razonamiento.
  • Prueba diferentes requisitos de formato de salida.
  • Introduce detalles contextuales adicionales.

El objetivo es descubrir el conjunto mínimo de solicitudes que producen de forma consistente comportamientos de agente fiables y de alta calidad. Documenta los resultados de cada iteración, haciendo un seguimiento tanto del rendimiento cualitativo como de las métricas cuantitativas, como la precisión de la respuesta, la integridad y el cumplimiento de las restricciones especificadas.

Argumentos

Los argumentos pasan información de runtime dentro y fuera de un agente, al igual que las entradas y salidas para actividades o procesos. Un desencadenador de Orchestrator puede proporcionar valores de argumentos en runtime, y los argumentos de salida de un agente pueden impulsar procesos empresariales posteriores.

El agente solo ve los argumentos a los que se hace referencia explícitamente en la solicitud del usuario. Para obtener instrucciones sobre cómo crear argumentos y hacer referencia a ellos en solicitudes, consulta Definir argumentos.

¿Te ha resultado útil esta página?

Conectar

¿Necesita ayuda? Soporte

¿Quiere aprender? UiPath Academy

¿Tiene alguna pregunta? Foro de UiPath

Manténgase actualizado