#how can i pass information from api to global system prompt in python
1 messages · Page 1 of 1 (latest)
Currently, the ElevenLabs Conversational AI system does not support variables in the global system prompt. This means you can't dynamically pass information from your API to the system prompt at runtime.
However, there is a workaround you can use. Instead of trying to modify the global system prompt, you can provide context dynamically when starting a new conversation session using the API. Here's an example of how you can do this in Python:
conversation = await Conversation.startSession({
"overrides": {
"agent": {
"prompt": {
"prompt": f"The customer's bank account balance is {customer_balance}. They are based in {customer_location}."
},
"first_message": f"Hi {customer_name}, how can I help you today?"
},
"tts": {
"voiceId": "" # You can override the voice ID dynamically here
}
}
})
By using this method, you can create a single agent and provide dynamic context for each customer conversation at runtime. This approach allows you to bypass the need for manual configuration in the UI and achieve a similar result to having variables in the system prompt.
It's worth noting that the ElevenLabs team is actively working on implementing support for system prompt variables. This feature may become available in the near future, which would provide a more direct solution to your needs.
so above is jus the context right