node-red-contrib-email-analysis-deepseek
v1.0.0
Published
AI-powered email analysis using DeepSeek API for Node-RED
Maintainers
Readme
node-red-contrib-email-analysis-deepseek
AI-powered email analysis using DeepSeek API for Node-RED.
Features
- AI Email Analysis: Automatically analyzes email content using DeepSeek AI
- Intent Detection: Identifies sender's real intent and needs
- Key Information Extraction: Extracts important points like time, place, people
- Reply Suggestions: Provides professional reply recommendations
- Bilingual Support: English and Chinese analysis versions
- Easy Configuration: Simple setup with API key configuration
Installation
cd ~/.node-red
npm install node-red-contrib-email-analysis-deepseekThen restart Node-RED.
Usage
1. Add Node to Flow
After installation, you'll find two new nodes in the Node-RED palette:
- Email Analysis DeepSeek (English output)
- 邮件分析 DeepSeek (Chinese output)
2. Configure the Node
- Double-click the node to open configuration
- Set your DeepSeek API Key (required)
- Configure optional parameters:
- Model: Choose between
deepseek-chatordeepseek-coder - Max Tokens: Maximum response length (default: 1000)
- Temperature: Response creativity 0-2 (default: 0.2)
- Output Language: English or Chinese (English node only)
- Model: Choose between
3. Input Format
The node expects email data in the following format:
{
from: "[email protected]",
to: "[email protected]",
subject: "Email Subject",
text: "Email content...",
date: "2024-01-01T12:00:00Z",
messageId: "unique-message-id"
}4. Output Format
The node outputs a structured analysis:
{
success: true,
timestamp: "2024-01-01T12:00:00Z",
emailSummary: {
from: "[email protected]",
subject: "Email Subject",
preview: "Email content preview...",
date: "2024-01-01T12:00:00Z",
messageId: "unique-message-id"
},
fullEmailContent: "Full email content...",
aiAnalysis: "AI analysis with intent, key info, and suggested reply",
tokenUsage: {
prompt_tokens: 100,
completion_tokens: 50,
total_tokens: 150
}
}API Key Setup
- Visit DeepSeek
- Sign up and create an account
- Generate an API key
- Copy the key (starts with
sk-) - Paste it in the node configuration
Example Flow
[
{
"id": "email-input",
"type": "inject",
"payload": {
"from": "[email protected]",
"to": "[email protected]",
"subject": "Urgent: Need Help",
"text": "I need immediate assistance with my order...",
"date": "2024-01-01T12:00:00Z",
"messageId": "msg-001"
}
},
{
"id": "email-analysis",
"type": "email-analysis-deepseek",
"apiKey": "sk-your-api-key-here",
"model": "deepseek-chat",
"maxTokens": 1000,
"temperature": 0.2,
"language": "english"
},
{
"id": "output",
"type": "debug"
}
]Node Types
Email Analysis DeepSeek
- Category: Analysis
- Inputs: 1
- Outputs: 1
- Language: English output
- Features: Configurable output language
邮件分析 DeepSeek (Chinese)
- Category: Analysis
- Inputs: 1
- Outputs: 1
- Language: Chinese output only
- Features: Optimized for Chinese analysis
Error Handling
The node includes comprehensive error handling:
- API Key Validation: Checks for valid API key format
- Network Errors: Handles connection issues gracefully
- API Errors: Provides detailed error messages
- Invalid Input: Validates input data format
Dependencies
- axios: HTTP client for API requests
- Node-RED: Version 3.0.0 or higher
- Node.js: Version 16.0.0 or higher
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- Issues: GitHub Issues
- Documentation: Node-RED Flow Library
- DeepSeek API: DeepSeek Documentation
Changelog
1.0.0
- Initial release
- English and Chinese analysis nodes
- DeepSeek API integration
- Comprehensive error handling
- Multi-language support
