https://retellai.com/?utm_source=discord&utm_medium=seo logo
s
@AI Evy hi
a
Thanks for tagging me @Sergiomaru. I'll look through relevant sources and get back to you shortly.
### Answer Hi! I'm an AI assistant knowledgeable about Retell AI. I use documentation and other sources to help answer questions you might have. Let me know how I can be helpful.
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
Cómo puedo cambiar un agente de voz retell de single a multi
@AI Evy Cómo puedo cambiar un agente de voz retell de single a multi
a
Thanks for the follow-up, @Sergiomaru. I'll get back to you soon.
### Answer Para convertir un agente de single-prompt a multi-prompt, necesitas agregar states (estados) a tu configuración del Retell LLM. [(1) ]() Un agente multi-prompt utiliza estados que dividen conversaciones complejas en etapas distintas, cada una con su propio prompt y herramientas permitidas. [(2) ]() Cómo hacerlo: 1. **Vía API**: Usa el endpoint de actualización del LLM para agregar el campo
states
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:
Copy code
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) ]()
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[2] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy cual es el api
a
Thanks for the follow-up, @Sergiomaru. I'll get back to you soon.
### Answer Para actualizar un Retell LLM y agregar estados (multi-prompt) , el endpoint de la API es: [(1) ]() PATCH
/update-retell-llm/{llm_id}
Ejemplo de código en JavaScript:
Copy code
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
Copy code
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.
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[2] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy estoy en la web de retell ya ingresé el apikey y el llmId que más debo ingresar para cambiar este agente de single a multi agent
a
Thanks for the follow-up, @Sergiomaru. I'll get back to you soon.
### Answer Para cambiar tu agente de single-prompt a multi-prompt usando la API, necesitas enviar estos campos en el body de la solicitud PATCH: [(1) ]() Campos requeridos para multi-prompt: 1.
states
- 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:
Copy code
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.
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy ahora como volver un agente de chat también de single agente a multiprompt es el mismo.proceso?
a
Thanks for the follow-up, @Sergiomaru. I'll get back to you soon.
### Answer Sí, el proceso es el mismo. El Retell LLM Response Engine se utiliza tanto para agentes de voz como para agentes de texto/chat. [(1) ]() Para convertir cualquier agente (voz o chat) de single-prompt a multi-prompt, debes actualizar el LLM asociado agregando el campo
states
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:
Copy code
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) ]()
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[2] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.