#can i pass prompt in to converational ai programmatically ? the prompt will have dynamic data

1 messages · Page 1 of 1 (latest)

dusky turretBOT
#
AI-generated Answer for jubilant_fawn_37156

Yes, you can pass dynamic prompts programmatically ElevenLabs Conversational AI using the API. This allows you to provide context dynamically for each conversation without needing to manually configure settings in the UI.

For example, you can use the API to start a session and include dynamic data in the prompt and first message:

const conversation = await Conversation.startSession({
  overrides: {
    agent: {
      prompt: {
        prompt: `The customer's bank account balance is ${customer_balance}. They are based in ${customer_location}.`
      },
      first_message: `Hi ${customer_name}, how can I help you today?`,
    },
    tts: {
      voiceId: "" // override the voice ID dynamically
    }
  },
  ...
});

This method allows you to dynamically customize the agent's behavior for each conversation at runtime. Let me know if you need further clarification!

proper idol
#

hello I would like to have some help please 🙂 if i use Starting ElevenLabs session with config: {
"agentId": "yJTbP4WdYahURmMC2Do2",
"preferHeadphonesForIosDevices": true,
"connectionDelay": {
"android": 3000,
"ios": 500,
"default": 0
},
"overrides": {
"agent": {
"language": "en"
}
}
} it works but if i had tts : config: {
"agentId": "yJTbP4WdYahURmMC2Do2",
"preferHeadphonesForIosDevices": true,
"connectionDelay": {
"android": 3000,
"ios": 500,
"default": 0
},
"overrides": {
"agent": {
"language": "en"
},
"tts": {
"voiceId": "5Qfm4RqcAer0xoyWtoHC"
}
}
} it crash : @11labs_client.js?v=8764b7b0:263 WebSocket is already in CLOSING or CLOSED state.
sendMessage @ @11labs_client.js?v=8764b7b0:263
onInputWorkletMessage @ @11labs_client.js?v=8764b7b0:377 could you help me please ? i use "@11labs/client": "^0.1.3",