Chat 🟢 GA - AI Assistant

Chat message flow

Your intelligent conversation partner

Chat Interface Screen

Overview

Chat is the heart of General Bots Suite - your AI-powered assistant that understands context, remembers conversations, and helps you get things done. Built with WebSocket for real-time communication and HTMX for seamless updates.


Features

Real-Time Messaging

Messages are sent and received instantly via WebSocket connection.

Voice Input

Click the microphone button to speak your message:

  1. Click 🎤 to start recording
  2. Speak your message clearly
  3. Click again to stop
  4. Message converts to text automatically

Quick Suggestions

Pre-built action chips for common requests:

ChipAction
📊 TasksShow your task list
📧 Check mailDisplay unread emails
📅 ScheduleToday’s calendar
❓ HelpAvailable commands

Response Format Switchers

Persistent toggle buttons that control how AI formats responses. Unlike suggestions, switchers stay active until deactivated and can be combined.

Available Format Options:

IDLabelDescriptionExample Use Case
tablesTabelasResponses as structured HTML tablesComparisons, data summaries
infographicInfográficoVisual SVG and progress bar representationsStatistics, metrics, dashboards
cardsCardsCard-based HTML layout with borders and shadowsProfiles, items, entities
listListaBulleted and numbered HTML listsSteps, features, options
comparisonComparaçãoSide-by-side HTML grid comparisonsPros/cons, alternatives
timelineTimelineChronological HTML timeline with border markersHistory, events, milestones
markdownMarkdownStandard CommonMark formattingDocumentation, code
chartGráficoSVG charts (line, bar, pie, area) with axes and legendsData visualization

Custom Switchers: You can also add custom format instructions:

ADD SWITCHER "sempre mostrar 10 perguntas" AS "Mostrar Perguntas"

Using Switchers:

  1. Click any format chip to toggle it ON
  2. Active switchers are highlighted with their color
  3. Multiple switchers can be active simultaneously
  4. Click again to toggle OFF
  5. Format applies to all responses until deactivated

Example Workflow:

Technical Implementation:

  • Switchers are defined in start.bas using: ADD SWITCHER "id" AS "Label"
  • Standard switchers use predefined IDs that map to backend prompts
  • Custom switchers allow any instruction string: ADD SWITCHER "custom prompt" AS "Label"
  • Frontend injects active switcher prompts into every user message
  • Prompts are prepended with “—” separator
  • Bot passes the enhanced message directly to LLM (no parsing needed)
  • LLM follows the REGRAS DE FORMATO instructions to format output
  • State is maintained during conversation session
  • Each format has distinct color coding for easy identification
  • Multiple switchers can be active simultaneously (all prompts concatenated)

Message History

  • Auto-loads previous messages on page open
  • Scroll up to load older messages
  • Click “Scroll to bottom” button to return to latest

Markdown Support

Bot responses support full Markdown rendering:

  • Bold and italic text
  • code snippets and code blocks
  • Bullet and numbered lists
  • Links and images
  • Tables

Keyboard Shortcuts

ShortcutAction
EnterSend message
Shift+EnterNew line (without sending)
↑ (Up arrow)Edit last message
/Open command menu
EscapeCancel current action

API Endpoints

WebSocket Connection

ws://your-server:9000/ws

Message Types:

  • TEXT (1) - Regular text messages
  • VOICE (2) - Voice messages
  • CONTINUE (3) - Continue interrupted responses
  • CONTEXT (4) - Context changes
  • SYSTEM (5) - System messages

REST Endpoints

EndpointMethodDescription
/api/sessionsGETList sessions
/api/sessions/current/messagePOSTSend message (current session)
/api/sessions/current/historyGETGet chat history (current session)
/api/sessions/:idGETGet session details
/api/sessions/:id/historyGETGet chat history by ID
/api/sessions/:id/startPOSTStart session
/api/sessions/:id/endPOSTEnd session
/api/voice/startPOSTStart voice recording
/api/voice/stopPOSTStop voice recording
/api/voice/statusGETGet voice status

Note: The frontend uses /api/sessions/current/* endpoints which resolve to the active session automatically.


Example Conversations

Getting Information

Creating Tasks

Drafting Emails


Accessibility

  • Full keyboard navigation
  • Screen reader announcements for new messages
  • High contrast mode support
  • Adjustable font sizes
  • ARIA labels on all interactive elements

Troubleshooting

Messages Not Sending

  1. Check connection status indicator
  2. Verify WebSocket is connected
  3. Try refreshing the page
  4. Check browser console for errors

Voice Not Working

  1. Allow microphone permissions in browser
  2. Check device microphone settings
  3. Try a different browser
  4. Ensure HTTPS connection (required for voice)

History Not Loading

  1. Check network connection
  2. Verify API endpoint is accessible
  3. Clear browser cache
  4. Check for JavaScript errors

See Also