Examples
Complete Request/Response Example
Input Request
{
"input": {
"messages": [
{
"originator": "bot",
"text": "Hello, can you hear me?",
"is_processed": true
},
{
"originator": "user",
"text": "How are you doing?",
"is_processed": true
},
{
"originator": "bot",
"text": "Great! You?",
"is_processed": true
},
{
"id": 4,
"type": "text",
"originator": "user",
"text": "Me too!!",
"is_processed": false
},
{
"id": 5,
"type": "text",
"text": "What are you doing tonight?",
"is_processed": false
},
{
"id": 6,
"type": "audio",
"text": null,
"audio_file_id": "msg1",
"is_processed": false
}
],
"audio_files": {
"msg1": ""
},
"character": "github:partner/character",
"character_params": {
"anything_you_want": "Those parameters will be used to render the character prompt template.",
"user_tier": "Premium",
"user_hair_color": "Blonde"
},
"generate_audio": true
}
}
Output Response
{
"messages": [
{
"id": 4,
"type": "text",
"text": "Me too!!"
},
{
"id": 5,
"type": "text",
"text": "What are you doing tonight?"
},
{
"id": 6,
"type": "audio",
"text": "",
"audio_file_id": "msg1"
},
{
"type": "audio",
"text": "Getting dinner with friends, you?",
"audio_file_id": "response",
"options": [
{"type": "audio", "text": "Getting dinner with friends, you?"}
]
}
],
"audio_files": {
"response": "<base64-encoded audio>"
}
}
Multiple Response Options Example
Request multiple response variants using num_options. Audio generation must be disabled when requesting multiple options.
Input Request
{
"input": {
"messages": [
{
"originator": "user",
"text": "What should we do tonight?",
"is_processed": true
},
{
"id": 1,
"type": "text",
"text": "I'm feeling adventurous!",
"is_processed": false
}
],
"character": "github:partner/character",
"num_options": 3,
"generate_audio": false
}
}
Output Response
{
"messages": [
{
"id": 1,
"type": "text",
"text": "I'm feeling adventurous!"
},
{
"type": "text",
"text": "How about we go stargazing at the hilltop?",
"options": [
{"type": "text", "text": "How about we go stargazing at the hilltop?"},
{"type": "text", "text": "Let's try that new escape room downtown!"},
{"type": "text", "text": "We could go for a midnight hike in the park."}
]
}
],
"audio_files": {}
}
The options array contains all response variants. The main text field contains the first option for backwards compatibility.