Processes raw binary audio or text. Handles commands (Call/SMS enriched via Contact & Portal APIs) and general AI queries.
Authentication: header required for /assistant, /api/text.Body: Raw PCM audio (e.g., Content-Type: audio/l16; rate=16000)
Response: Command JSON (Result:0, X-Response-Type:command) or AI Text (Result:0, X-Response-Type:ai_text) or AI Audio Stream (Result:1, X-Response-Type:ai_audio with X-Response-Text header).
// Example Command Response (Call Mom)
{
"feature": 7,
"parameters": { "who": "Mom", "to": "+123...", "contact_name": "Mom (Mobile)" }
}
// Example Command Response (Message Portal Success - Handled by Server, User gets Confirmation via AI Text/Audio)
// The direct response from /assistant would be the confirmation text/audio.
// If you need ESP32 to know portal message was attempted, server would need to send command JSON like:
// { "feature": 9, "parameters": { "recipient": "PORTAL", "status": "sent_to_portal", "api_response": { ...portal_api_json_response... } } }
// Current logic: if portal send succeeds/fails, it returns (user_message, False) to trigger AI text/audio response.
Body: JSON {"text": "user query"}
Response: Command JSON or AI Text JSON {"response": "...", "is_command": false}.
Service status.