https://github.com/laoning666/synology-chat-bot
3.9K
An AI-powered chatbot for Synology Chat that enables users to interact directly with AI models (such as GPT) within their chat interface.
docker pull laoning666/synology-chat-bot:latest
docker run -d \
--name synology-chat-bot \
-p 8008:8008 \
-e CHAT_API_URL=YOUR_API_URL \
-e CHAT_API_KEY=YOUR_API_KEY \
-e CHAT_API_MODEL=YOUR_MODEL \
-e SYNOLOGY_INCOMING_WEBHOOK_URL=YOUR_WEBHOOK_URL \
-e SYNOLOGY_OUTGOING_WEBHOOK_TOKEN=YOUR_TOKEN \
laoning666/synology-chat-bot:latest
Copy .env.example to .env in your local directory
Modify the environment variables in .env
Run with the following docker-compose.yml:
version: '3.8'
services:
synology-chat-bot:
image: laoning666/synology-chat-bot
container_name: synology-chat-bot
ports:
- "8008:8008"
restart: unless-stopped
http://your_server_ip:8008/webhook (Note: your_server_ip is the IP address of the server running the bot service)| Variable | Description | Default |
|---|---|---|
| CHAT_API_URL | AI API endpoint | - |
| CHAT_API_KEY | API authentication key | - |
| CHAT_API_MODEL | AI model identifier | - |
| CHAT_API_TEMPERATURE | Response randomness (0.0-1.0) | 0.7 |
| CHAT_API_MAX_TOKENS | Maximum response length | 4096 |
| CHAT_API_SYSTEM_PROMPT | AI system prompt | "I'm an AI assistant ready to help you." |
| Variable | Description | Default |
|---|---|---|
| SYNOLOGY_INCOMING_WEBHOOK_URL | Webhook URL for sending messages | - |
| SYNOLOGY_OUTGOING_WEBHOOK_TOKEN | Token for validating incoming webhooks | - |
| Variable | Description | Default |
|---|---|---|
| SERVER_HOST | Server host address | 0.0.0.0 |
| SERVER_PORT | Server port | 8008 |
| SERVER_DEBUG | Debug mode | False |
| Variable | Description | Default |
|---|---|---|
| CONVERSATION_MAX_HISTORY | Maximum conversation history entries | 10 |
| CONVERSATION_TIMEOUT | Session timeout (seconds) | 1800 |
| CONVERSATION_TYPING_TEXT | Typing indicator text | ... |
| Variable | Description | Default |
|---|---|---|
| HTTP_TIMEOUT | HTTP request timeout (seconds) | 30 |
| HTTP_MAX_RETRIES | Maximum retry attempts | 3 |
Create Incoming Webhook:
Create Outgoing Webhook:
synology-chat-bot/
āāā app.py # Application entry
āāā config/
ā āāā settings.py # Configuration management
āāā src/
ā āāā bot/
ā ā āāā chat_manager.py # Chat session management
ā ā āāā message_handler.py # Message processing
ā āāā models/
ā ā āāā conversation.py # Session state
ā āāā utils/
ā āāā http_client.py # HTTP client utilities
āāā Dockerfile # Docker configuration
āāā requirements.txt # Python dependencies
āāā .env # Environment variables
git checkout -b feature/NewFeature)git commit -m 'Add new feature')git push origin feature/NewFeature)Q: How to modify the AI model's response style? A: Customize the AI's system prompt by modifying the CHAT_API_SYSTEM_PROMPT environment variable.
Q: Will data be lost after session timeout? A: Yes, expired sessions are automatically cleared. Adjust CONVERSATION_TIMEOUT to modify the timeout duration.
Q: Which AI models are supported? A: Any model compatible with the OPEN API format, including OpenAI's GPT series, Claude, etc.
Q: How is message security ensured? A: The system uses webhook token validation and supports HTTPS encrypted transmission.
Q: Is streaming output supported? A: No, as Synology Chat doesn't support this feature.
This project is licensed under the MIT License - see the LICENSE file for details
Content type
Image
Digest
sha256:4a7c1245cā¦
Size
53.5 MB
Last updated
10 months ago
docker pull laoning666/synology-chat-bot