#Hello, I'm trying to configure the
1 messages · Page 1 of 1 (latest)
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
You mean
const initialConfig = {
type: "conversation_initiation_client_data",
convesation_config_override: {
agent: { prompt: { prompt: "Hello world" } },
},
};
right?
yes
Quick q. Is there a way to define the first message as well when you customise the agent?
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" } }, };
yes @raw night that looks correct
Thanks guys!
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?
@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 ?
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
Yup I took a look and know what the config object looks like. Just not sure where to send the object when setting up the websocket. Appreciate the guidance!
+1 here and thanks for the guidance as well!
@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));
});
Ah tysm @sleek hollow !
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!
Documentation for elevenlabs.io/docs. Contribute to elevenlabs/elevenlabs-docs development by creating an account on GitHub.
@limpid charm check this thread for inspo with override
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)
The documentation has been updated, thanks for the point out!