Usage Modes - Agent Hustle
Agent Hustle offers three flexible interaction modes to suit different application needs - from simple CLI tools to complex interactive UIs with real-time streaming.
1️⃣ Simple Request/Response
Perfect for CLI tools or simple applications - send a message, get back a complete response:
Basic Usage
JA
simple-mode.jsLoading...
✅ Best For
- • CLI applications
- • Batch processing
- • Simple integrations
- • One-time queries
- • Testing and prototyping
📊 Response Structure
JS
response-structure.jsonLoading...
2️⃣ Processed Streaming (for interactive UIs)
Receive typed, structured chunks for building interactive experiences:
Streaming Implementation
JA
processed-streaming.jsLoading...
📱 Perfect For
- • Chat interfaces
- • Real-time dashboards
- • Interactive applications
- • Progressive loading UIs
- • Tool execution tracking
📦 Chunk Types
text- Streaming text contenttool_call- Tool execution startedtool_result- Tool execution completedfinish- Stream complete3️⃣ Raw API Streaming (maximum control)
Direct access to the raw API stream format for maximum control and custom processing:
Raw Stream Implementation
JA
raw-streaming.jsLoading...
🔧 Advanced Use Cases
- • Custom protocol handling
- • Performance optimization
- • Custom chunk processing
- • Protocol debugging
- • Advanced integrations
🏷️ Prefix Types
'0'- Text chunk'9'- Tool call'a'- Tool result'f'- Message ID'2'- Path info'e'/'d'- Completion events📊 Mode Comparison
| Feature | Simple | Processed Streaming | Raw Streaming |
|---|---|---|---|
| Complexity | Low | Medium | High |
| Real-time Updates | No | Yes | Yes |
| Tool Tracking | After completion | Real-time | Real-time |
| Custom Processing | Limited | Good | Full control |
| Best For | CLI, Scripts | Chat UIs, Dashboards | Custom integrations |
🎯 Choosing the Right Mode
🔨 Use Simple Mode When:
- • Building CLI tools
- • Processing batches
- • Simple integrations
- • You don't need real-time updates
- • Prototyping quickly
💬 Use Processed Streaming When:
- • Building chat interfaces
- • Creating interactive UIs
- • Showing tool execution progress
- • Real-time user feedback needed
- • Progressive content display
⚙️ Use Raw Streaming When:
- • Custom protocol needed
- • Performance optimization required
- • Debugging API interactions
- • Complex integration patterns
- • Full control over processing
💡 Pro Tips
- • Start with Simple mode for prototyping, then upgrade as needed
- • Use Processed Streaming for most production UIs
- • Implement error handling for all streaming modes
- • Consider network conditions when choosing streaming vs simple
- • Use tool tracking to show users what's happening behind the scenes