@spectrumsense/spectrum-chat-dev
Version:
Embeddable AI Widget - Add trusted, evidence-based answers directly to your website. Simple installation, enterprise-grade security.
54 lines (40 loc) • 1.46 kB
Markdown
# Real API Server Examples
These examples use your actual API server running on port 8000 for production testing.
## Setup
1. **Start your actual API server on port 8000:**
```bash
# Replace with your actual server command
# python your-api-server.py
# node your-api-server.js
# your-server-command --port 8000
```
2. **Start the web server:**
```bash
python -m http.server 3000
```
3. **Open examples:**
- Plain HTML: http://localhost:3000/examples/real/plain-html-example.html
- Template Base: http://localhost:3000/examples/real/template-base.html
- Template Home: http://localhost:3000/examples/real/template-home.html
## Features
- ✅ **Real API integration** - Connects to your actual server
- ✅ **Production testing** - Test with real data and responses
- ✅ **End-to-end validation** - Verify complete functionality
- ✅ **Performance testing** - Test with real server performance
## API Requirements
Your server must support these endpoints:
- `POST /api/v1/conversations` - Create new conversation
- `POST /api/v1/conversations/{id}` - Continue conversation
## Expected Response Format
```json
{
"text": "Response message",
"role": "assistant",
"conversation_id": "conv_123",
"timestamp": "2024-01-01T12:00:00Z"
}
```
## Troubleshooting
- Ensure your server is running on port 8000
- Check CORS settings if you see network errors
- Verify API response format matches expected structure