- Información general
- Primeros pasos con los agentes de UiPath
- Introducción
- Configura tu entorno
- Crear el agente
- Probar el agente
- Primeros pasos con los agentes de UiPath utilizando LangGraph
- Crear un agente de código bajo en Studio Web
- Añadir herramientas a tu agente de UiPath
Define el contrato de agente, escribe la solicitud del sistema y configura los esquemas de entrada y salida en agent.json.
Con la CLI instalada y tu cuenta de UiPath conectada, estás listo para andamiar el agente.
Paso 4: andamiar la solución y el agente
Los agentes de código bajo residen dentro de una solución, la unidad implementable que la CLI carga en Studio Web. Primero creas la solución y luego aplicas andamios al agente que contiene.
-
Crea un directorio de trabajo y aplica andamios a la solución:
mkdir Monster-Selector-Lab cd Monster-Selector-Lab uip solution init MonsterSelectormkdir Monster-Selector-Lab cd Monster-Selector-Lab uip solution init MonsterSelectorEsto crea un directorio
MonsterSelector/que contieneMonsterSelector.uipx(el manifiesto de la solución), másAGENTS.mdyCLAUDE.mdarchivos de resumen que orientan a los agentes de codificación a la estructura de la solución. -
Aplica andamios al proyecto del agente dentro del directorio de la solución:
uip agent init MonsterSelector/MonsterSelectoruip agent init MonsterSelector/MonsterSelectoruip agent init <path>el proyecto de agente en la ruta dada y lo registra automáticamente con la solución. Generaagent.json(la solicitud del sistema, los esquemas y la configuración del modelo),entry-points.json, un andamioevals/vacío y un ID de proyecto generado automáticamente. -
Vaya al directorio de soluciones para los pasos restantes:
cd MonsterSelectorcd MonsterSelector
Dos directorios llamados SelectorMonstruos. Tu directorio de laboratorio ahora contiene MonsterSelector/ (la solución) que a su vez contiene otro MonsterSelector/ (el proyecto de agente). Esto es normal: la solución y el proyecto de agente pueden compartir un nombre. A medida que avanzas en los siguientes pasos, presta atención al directorio en el que te encuentras. El paso 4 termina contigo dentro del directorio de la solución (Monster-Selector-Lab/MonsterSelector/).
Paso 5: configurar el agente
La configuración del agente está definida por los archivos agent.json y entry-points.json . Estos se editan directamente para implementar el diseño desde el principio de este lab, reemplazando el contenido del marcador de posición que generó el andamio.
Configurar agent.json
Para reemplazar el andamio, abre MonsterSelector/agent.json (relativo al directorio de soluciones en el que te encuentras). Reemplace todo su contenido por lo siguiente. La única excepción es el valor projectId en la última línea; mantén el UUID que generó tu andamio en lugar de utilizar el marcador de posición que se muestra aquí.
El siguiente JSON implementa el diseño de Lo que estás creando:
- Esquema de entrada:
questDescription(cadena) ymonsters(matriz), ambos obligatorios. - Esquema de salida:
monsterIndex(cadena). - Solicitud del sistema: el texto de instrucción en
messages[0](el rolsystem) que le dice al modelo cómo razonar. - Turno de usuario: el mensaje en
messages[1](el roluser) que llevaquestDescriptionymonstersa la solicitud en tiempo de ejecución: este es el turno de conversación de LLM, no un usuario final humano.
{
"version": "1.1.0",
"settings": {
"model": "gpt-4.1-2025-04-14",
"maxTokens": 16384,
"temperature": 0,
"engine": "basic-v2",
"maxIterations": 25,
"mode": "standard"
},
"inputSchema": {
"type": "object",
"properties": {
"questDescription": {
"type": "string",
"description": "Description of the quest"
},
"monsters": {
"type": "array",
"description": "Candidate monsters from the D&D 5e API"
}
},
"required": ["questDescription", "monsters"]
},
"outputSchema": {
"type": "object",
"properties": {
"monsterIndex": {
"type": "string",
"description": "The index slug of the chosen monster"
}
}
},
"metadata": {
"storageVersion": "50.0.0",
"isConversational": false,
"showProjectCreationExperience": false,
"targetRuntime": "pythonAgent"
},
"type": "lowCode",
"messages": [
{
"role": "system",
"content": "You are an RPG game master helping to select the most thematically appropriate monster for a quest. Given a quest description and a list of candidate monsters (each with a name and an index slug), pick the ONE monster whose lore, environment, or threat level best fits the quest. Return ONLY the index slug of your chosen monster. Do not return the full object or any commentary - just the string slug. If multiple candidates fit, favor the most iconic or thematically resonant choice.",
"contentTokens": [
{
"type": "simpleText",
"rawString": "You are an RPG game master helping to select the most thematically appropriate monster for a quest. Given a quest description and a list of candidate monsters (each with a name and an index slug), pick the ONE monster whose lore, environment, or threat level best fits the quest. Return ONLY the index slug of your chosen monster. Do not return the full object or any commentary - just the string slug. If multiple candidates fit, favor the most iconic or thematically resonant choice."
}
]
},
{
"role": "user",
"content": "{{input.questDescription}} {{input.monsters}}",
"contentTokens": [
{ "type": "variable", "rawString": "input.questDescription" },
{ "type": "simpleText", "rawString": " " },
{ "type": "variable", "rawString": "input.monsters" }
]
}
],
"projectId": "your-scaffold-generated-uuid-here"
}
{
"version": "1.1.0",
"settings": {
"model": "gpt-4.1-2025-04-14",
"maxTokens": 16384,
"temperature": 0,
"engine": "basic-v2",
"maxIterations": 25,
"mode": "standard"
},
"inputSchema": {
"type": "object",
"properties": {
"questDescription": {
"type": "string",
"description": "Description of the quest"
},
"monsters": {
"type": "array",
"description": "Candidate monsters from the D&D 5e API"
}
},
"required": ["questDescription", "monsters"]
},
"outputSchema": {
"type": "object",
"properties": {
"monsterIndex": {
"type": "string",
"description": "The index slug of the chosen monster"
}
}
},
"metadata": {
"storageVersion": "50.0.0",
"isConversational": false,
"showProjectCreationExperience": false,
"targetRuntime": "pythonAgent"
},
"type": "lowCode",
"messages": [
{
"role": "system",
"content": "You are an RPG game master helping to select the most thematically appropriate monster for a quest. Given a quest description and a list of candidate monsters (each with a name and an index slug), pick the ONE monster whose lore, environment, or threat level best fits the quest. Return ONLY the index slug of your chosen monster. Do not return the full object or any commentary - just the string slug. If multiple candidates fit, favor the most iconic or thematically resonant choice.",
"contentTokens": [
{
"type": "simpleText",
"rawString": "You are an RPG game master helping to select the most thematically appropriate monster for a quest. Given a quest description and a list of candidate monsters (each with a name and an index slug), pick the ONE monster whose lore, environment, or threat level best fits the quest. Return ONLY the index slug of your chosen monster. Do not return the full object or any commentary - just the string slug. If multiple candidates fit, favor the most iconic or thematically resonant choice."
}
]
},
{
"role": "user",
"content": "{{input.questDescription}} {{input.monsters}}",
"contentTokens": [
{ "type": "variable", "rawString": "input.questDescription" },
{ "type": "simpleText", "rawString": " " },
{ "type": "variable", "rawString": "input.monsters" }
]
}
],
"projectId": "your-scaffold-generated-uuid-here"
}
temperature: 0. reduce la varianza de salida, pero no hace que el modelo sea completamente determinista. Incluso en 0, el modelo puede devolver ocasionalmente diferentes salidas válidas en las ejecuciones. Para este agente, cualquier elección de monstruo defendible es correcta; la reproducibilidad exacta de la cadena no es el objetivo.
Configurar entrada-points.json
Ahora abre MonsterSelector/entry-points.json y reemplaza todo su contenido por lo siguiente. De nuevo, mantén el valor uniqueId que generó tu andamio en lugar de utilizar el marcador de posición.
El siguiente JSON define un único punto de entrada agent , al que llamas en los siguientes pasos. Una solución puede exponer varios puntos de entrada (por ejemplo, una variante simple y una variante de entrada extendida del mismo agente), pero uno es todo lo que necesitamos aquí.
{
"$schema": "https://cloud.uipath.com/draft/2024-12/entry-point",
"$id": "entry-points.json",
"entryPoints": [
{
"filePath": "/content/agent.json",
"uniqueId": "your-scaffold-generated-uuid-here",
"type": "agent",
"input": {
"type": "object",
"properties": {
"questDescription": {
"type": "string",
"description": "Description of the quest"
},
"monsters": {
"type": "array",
"description": "Candidate monsters from the D&D 5e API"
}
},
"required": ["questDescription", "monsters"]
},
"output": {
"type": "object",
"properties": {
"monsterIndex": {
"type": "string",
"description": "The index slug of the chosen monster"
}
}
}
}
]
}
{
"$schema": "https://cloud.uipath.com/draft/2024-12/entry-point",
"$id": "entry-points.json",
"entryPoints": [
{
"filePath": "/content/agent.json",
"uniqueId": "your-scaffold-generated-uuid-here",
"type": "agent",
"input": {
"type": "object",
"properties": {
"questDescription": {
"type": "string",
"description": "Description of the quest"
},
"monsters": {
"type": "array",
"description": "Candidate monsters from the D&D 5e API"
}
},
"required": ["questDescription", "monsters"]
},
"output": {
"type": "object",
"properties": {
"monsterIndex": {
"type": "string",
"description": "The index slug of the chosen monster"
}
}
}
}
]
}
Comprender agent.json y input-points.json
agent.jsones la definición del agente: la configuración del modelo, la solicitud del sistema y los esquemas de entrada y salida.entry-points.jsonexpone esos esquemas al runtime de la solución.- Importante: Los bloques
inputSchemayoutputSchemadeben ser idénticos en ambos archivos. Una falta de coincidencia hace que la validación falle.
Adaptarse a tu caso de uso. Para crear un agente diferente, reemplaza las cadenas content en messages[0] con tu solicitud del sistema y actualiza los bloques properties en inputSchema y outputSchema para que coincidan con los campos a los que se refiere tu solicitud. Refleja esos mismos cambios en entry-points.json. Las settings, metadata, type y la estructura del mensaje siguen siendo las mismas.
Paso 6: validar el agente
Desde el directorio de soluciones, valida el agente:
uip agent validate MonsterSelector
uip agent validate MonsterSelector
Debería ver "Status": "Valid" con "StorageVersion": "50.0.0" y un resumen "Validated" que muestra agent: true. La validación también genera los archivos .agent-builder/ utilizados por Studio Web; no es necesario tocarlos.
Si la validación falla, confirma que inputSchema y outputSchema son idénticos tanto en agent.json como en entry-points.json, y que cada referencia de variable en messages[1].content utiliza el prefijo input. (por ejemplo, {{input.questDescription}}).
Con el agente validado localmente, estás listo para cargarlo en Studio Web y ejecutar una prueba en vivo en la siguiente sección.