{{-- Create / edit AI agent — THE canonical form. Extracted from the team inbox so /devices can open the exact same modal when assigning an agent to a number. A trimmed second copy would drift: this form carries the knowledge base, canned answers, human-handoff rules and voice settings, and an agent created without them behaves differently from one made in the inbox. Requires the page to load the agent-form JS (see resources/js/charts). --}}
You give the agent a name, picture, and a "personality" prompt │ ▼ Operator opens a chat → clicks "AI Agent" → picks this agent │ ▼ Every inbound message in that chat → this agent replies │ ├── Reads the last 20 messages for context ├── Sends to your chosen model (ChatGPT / Gemini / etc.) ├── Sends the reply back as WhatsApp message └── Rates its own reply 1-10 (shown as ★ badge for managers) │ ▼ Want to take over? Just type a message yourself → agent stops automatically Tips: • Tone setting changes how casual or formal the bot sounds • Lower temperature = same answers each time, higher = more creative • Be specific in the prompt — "Reply briefly. Never quote prices."