curl --request POST \
--url https://api.example.com/api/context \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"scenario": "<string>"
}
'{
"ok": true,
"scenario": "<string>"
}Set business description and scenario to initialize the AI caller conversation
curl --request POST \
--url https://api.example.com/api/context \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"scenario": "<string>"
}
'{
"ok": true,
"scenario": "<string>"
}/api/chat will use this context.
true on success.description field is missing, empty, or contains only whitespace.
{
"error": "No description provided"
}
curl -X POST http://localhost:5000/api/context \
-H "Content-Type: application/json" \
-d '{
"description": "We are a pizza restaurant that takes orders and handles delivery inquiries.",
"scenario": "order a large pepperoni pizza for delivery"
}'
{
"ok": true,
"scenario": "order a large pepperoni pizza for delivery"
}
curl -X POST http://localhost:5000/api/context \
-H "Content-Type: application/json" \
-d '{
"description": "We are a tech support helpdesk."
}'
description field is trimmed of leading/trailing whitespace before validationscenario field is normalized using the normalize_scenario function which trims whitespace and applies the default if emptybusiness_description, scenario, messages