This topic describes how to set custom prompt variables using the Device-side C SDK.
1. Preparations
1.1. Prerequisites
- This topic builds on Implement chat capabilities using Device-side C SDK. Before you proceed, complete the environment setup described in that document.
- Make sure that you have integrated the SDK and that the interactive voice response (IVR) flow runs as expected.
1.2. Configure prompts
- Create an application in the Alibaba Cloud Model Studio console.
-
Modify the
Promptto add aCustom Variable.

2. Develop client-side features
2.1. Sample code
2.2. Key logs
3. Common scenarios
- You can use custom prompt variables to switch roles without switching the App ID. For example, you can define role properties such as name, age, gender, and hobbies.
- Alternatively, you can treat the entire prompt as a variable and pass parameters from the device to rewrite the prompt.