#Hello, I'm trying to configure the

1 messages · Page 1 of 1 (latest)

alpine trail
#

I think it should be

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.
      }
  },
  ...
})
#

so another "{ prompt: "asjhdbaksdhaskd"}" in your example

sharp trench
#

You mean

const initialConfig = {
          type: "conversation_initiation_client_data",
          convesation_config_override: {
            agent: { prompt: { prompt: "Hello world" } }, 
          },
        };

right?

alpine trail
#

yes

astral sphinx
#

Quick q. Is there a way to define the first message as well when you customise the agent?

raw night
# astral sphinx Quick q. Is there a way to define the first message as well when you customise t...

https://elevenlabs.io/docs/conversational-ai/customization/conversation-configuration

...
So if we take @sharp trench example it would be something like:
const initialConfig = { type: "conversation_initiation_client_data", convesation_config_override: { agent: { prompt: { prompt: "New cool prompt!" }, first_message: "Well hello there!" }, tts: { voiceId: "someOtherVoiceId" } }, };

ElevenLabs

Learn how to customize your AI agent for each conversation & pass additional metadata to the agent.

alpine trail
#

yes @raw night that looks correct

astral sphinx
#

Thanks guys!

sleek hollow
#

hey folks. thanks for this thread. unfortunately, i cant get overrides to work. i have overrides checked in the dashboard for my agent that

i have this code:

      `wss://api.elevenlabs.io/v1/convai/conversation?agent_id=${process.env.ELEVENLABS_AGENT_ID}`
    );

    // STEP 4: Set up ElevenLabs WebSocket event handlers
    elevenLabsWs.on("open", async () => {
      console.log("[II] Connected to Conversational AI.");

      // Initialize conversation with ElevenLabs
      // This sets up the AI's personality and initial behavior
      const initialConfig = {
        type: "conversation_initiation_client_data",
        conversation_config_overrides: {
          agent: {
            prompt: { prompt: "you are a pizza store worker." },
            first_message: "hey there would you like to order",
          },
        },
      };

      elevenLabsWs.send(JSON.stringify(initialConfig));
    });

this doesnt override the first message though. any ideas?

raw night
#

@alpine trail and @white cedar Perhaps you guys can provide a clear example on how to do this when working directly on the ElevenLabs WebSocket API ?

alpine trail
#

I will take a note to add an example over websockets, currently we have it for python / javascript etc but those are sdk examples

#

Take a look at python sdk implementation on websockets

sleek hollow
astral sphinx
#

+1 here and thanks for the guidance as well!

sleek hollow
# alpine trail https://github.com/elevenlabs/elevenlabs-python/blob/main/src/elevenlabs/convers...

@alpine trail thank you for that link. it helped me send overrides in correctly. i was off by 1 letter!

@astral sphinx here's the code to get it to work:

    elevenLabsWs.on("open", async () => {
      console.log("Connected to Conversational AI.");

      // Set up the conversational AI overrides
      const initialConfig = {
        type: "conversation_initiation_client_data",
        conversation_config_override: {
          agent: {
            prompt: { prompt: "you are a pizza store worker." },
            first_message: "hey there what would you like to order",
          },
        },
      };

      // send config to elevenlabs
      elevenLabsWs.send(JSON.stringify(initialConfig));
    });
astral sphinx
#

Ah tysm @sleek hollow !

alpine trail
#

Happy to hear @sleek hollow ! We will try to put an example, if you want to contribute to documentation we would love to work together as well!

raw night
#

@limpid charm check this thread for inspo with override

limpid charm
#

Thanks, but none of it worked for me. For those using the React SDK looking to implement agent overrides, here's the correct code to do it:

        overrides: {
          agent: {
            prompt: {
              prompt: 'You are an unhelpful assistant'
            },
            firstMessage: 'Hello, I have been overriden successfully' 
          }
        }

The override options need to be passed inside conversation.Start(), not conversation.Use() . Note how the firstMessage is spelled (and not as first_Message as it is incorrectly done in the Javascript documentation)

white cedar
#

The documentation has been updated, thanks for the point out!