Sergiomaru
03/03/2026, 5:17 PMAI Evy
03/03/2026, 5:17 PMAI Evy
03/03/2026, 5:17 PMAI Evy
03/03/2026, 5:17 PMAI Evy
03/03/2026, 5:17 PMSergiomaru
03/03/2026, 5:17 PMSergiomaru
03/03/2026, 5:18 PMAI Evy
03/03/2026, 5:18 PMAI Evy
03/03/2026, 5:18 PMstates con múltiples estados definidos. Cada estado incluye:
- `name`: nombre del estado
- `state_prompt`: prompt específico para ese estado
- `edges`: transiciones hacia otros estados
- `tools`: herramientas disponibles en ese estado [(1) ]()
2. También debes definir starting_state para indicar en qué estado comienza la conversación.
Ejemplo de estructura de estados:
json
"states": [
{
"name": "information_collection",
"state_prompt": "You will follow the steps below to collect information...",
"edges": [
{
"destination_state_name": "appointment_booking",
"description": "Transition to book an appointment."
}
]
},
{
"name": "appointment_booking",
"state_prompt": "You will follow the steps below to book an appointment..."
}
],
"starting_state": "information_collection"
Nota importante: Para tareas muy complejas con múltiples ramas de decisión o más de 5 herramientas, considera usar Conversation Flow en lugar de multi-prompt, ya que ofrece control más preciso. [(2) ]()AI Evy
03/03/2026, 5:18 PMAI Evy
03/03/2026, 5:18 PMSergiomaru
03/03/2026, 5:19 PMAI Evy
03/03/2026, 5:19 PMAI Evy
03/03/2026, 5:20 PM/update-retell-llm/{llm_id}
Ejemplo de código en JavaScript:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.update('16b980523634a6dc504898cda492e939', {
begin_message: 'Hey I am a virtual assistant calling from Retell Hospital.',
}) ;
console.log(llmResponse.llm_id) ;
Para crear un nuevo Retell LLM, el endpoint es: [(2) ]()
POST /create-retell-llm
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create() ;
console.log(llmResponse.llm_id) ;
Necesitas incluir el header de autorización con tu API key en el formato: "Bearer YOUR_API_KEY" [(1) ]()
Puedes encontrar tu API key en el dashboard de Retell AI.AI Evy
03/03/2026, 5:20 PMAI Evy
03/03/2026, 5:20 PMSergiomaru
03/03/2026, 5:28 PMAI Evy
03/03/2026, 5:28 PMAI Evy
03/03/2026, 5:29 PMstates - Array con tus estados definidos. Cada estado debe incluir:
- `name`: nombre único del estado
- `state_prompt`: el prompt específico para ese estado
- edges (opcional) : transiciones hacia otros estados
- tools (opcional) : herramientas disponibles en ese estado
2. starting_state - El nombre del estado inicial (requerido si defines estados)
3. general_prompt (opcional) - Prompt general que se aplica a todos los estados
Ejemplo del body JSON que debes enviar:
json
{
"states": [
{
"name": "information_collection",
"state_prompt": "You will follow the steps below to collect information...",
"edges": [
{
"destination_state_name": "appointment_booking",
"description": "Transition to book an appointment."
}
]
},
{
"name": "appointment_booking",
"state_prompt": "You will follow the steps below to book an appointment..."
}
],
"starting_state": "information_collection"
}
Si estás usando la interfaz web de prueba de la API en la documentación, simplemente ingresa este JSON en el campo "Body" junto con tu llm_id en el path y tu API key en el header de autorización.AI Evy
03/03/2026, 5:29 PMAI Evy
03/03/2026, 5:29 PMSergiomaru
03/03/2026, 9:46 PMAI Evy
03/03/2026, 9:46 PMAI Evy
03/03/2026, 9:46 PMstates con múltiples estados definidos y especificar el starting_state.
El endpoint es el mismo:
PATCH /update-retell-llm/{llm_id}
Ejemplo de código:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.update('16b980523634a6dc504898cda492e939', {
begin_message: 'Hey I am a virtual assistant calling from Retell Hospital.',
}) ;
console.log(llmResponse.llm_id) ;
El body JSON con los states y starting_state que te mostré anteriormente aplica de la misma manera para agentes de chat. La diferencia entre un agente de voz y uno de chat está en la configuración del agente mismo, no en el Retell LLM Response Engine que genera las respuestas. , [(2) ]()AI Evy
03/03/2026, 9:46 PMAI Evy
03/03/2026, 9:46 PM