@quec-wx-mp/api-ai
v1.0.0-alpha.0
Published
小程序插件 AI库
Readme
@quec-wx-mp/api-ai
🤖 Powerful AI Integration SDK for WeChat Mini Programs
Seamlessly connect your WeChat Mini Program with advanced AI capabilities including voice recognition, conversation memory, growth tracking, and intelligent interactions.
✨ Features
- AI Conversation Core - Advanced dialogue management with context-aware responses
- Memory System - Long-term conversation memory and personality-based interactions (MBTI)
- Growth Tracking - Baby development monitoring and task management
- Voice Technology - Voice print recognition, cloning, and text-to-speech
- Content Services - On-demand audio content and music streaming
- Usage Management - License tracking and quota management
- Customization - Configurable bot personalities, voices, and speech rates
- Risk Warning - Intelligent chat monitoring and safety alerts
📦 Installation
npm install @quec-wx-mp/api-ai🚀 Quick Start
1. Prerequisites
Before integrating the AI plugin, ensure you have:
- ✅ A registered WeChat Mini Program account
- ✅ The Quec WeChat Plugin already integrated into your Mini Program
2. Configure Plugin in app.json
Add the plugin configuration to your app.json file:
{
"plugins": {
"quecPlugin": {
"version": "1.0.0",
"provider": "wx5e9a3feb8df9122e"
}
}
}3. Initialize User Domain in app.js
Configure your user domain and secret key in app.js:
// Require the plugin
const plugin = requirePlugin('quecPlugin')
// Set user domain and secret
plugin.config.setUserDomain('your user domain')
plugin.config.setUserDomainSecret('your user domain secret')⚠️ Important: Replace
'your-user-domain'and'your-secret-key'with your actual credentials from the Quec platform.
4. Import and Inject AI SDK
Import the AI SDK and inject it into the plugin:
// Import the AI SDK
import sdk from '@quec-wx-mp/api-ai'
// Require the plugin (if not already done)
const plugin = requirePlugin('quecPlugin')
// Inject the SDK into the plugin
plugin.load(sdk)
// Verify successful installation
console.log('AI SDK Version:', plugin.ai.version)5. Verify Installation
After completing the setup, check the console output.
If you see the version number printed, the integration was successful! 🎉
Tips: For detailed documentation with Installation, visit our Wechat Plugin Documentation.
🎯 Core API Usage
💬 Chat Management
🧠 Memory Operations
👶 Baby Growth Tracking
🔊 Voice Print
📚 API Reference
Modules
| Module | Description | Key Methods |
|--------|-------------|-------------|
| Buy | Package & Order Management | findPackageListV2, createContentBizOrder |
| Chat | Conversation History | deleteHistoryV2 |
| Content | Audio Content Services | isShowOnDemand, onDemandCategory, onDemandTracklist |
| Growth Baby | Child Development | addBabyInfo, babyTaskList, getBabyInfo |
| Memory | Conversation Memory | findListV2, getSummaryV2, deviceResetV2 |
| MBTI | Personality System | getAiMemoryUserInfo, memoryCompare, memoryRemind |
| Voiceprint | Voice Recognition | uploadFeature, getFeature, updateDeviceVoicePrint |
| Usage | License & Quota | aiChatWarnStatus, aiChatPage, findLicenseTime |
| Bot | Bot Configuration | getSpeedConfig, setSpeedConfig, findBotList |
| Role | Character Settings | promptTemplateList, obtainPolishPrompt, findBotVoice |
| Summary | Daily Summaries | querySummaryGenerate, summaryCommon |
Complete API Documentation
For detailed API documentation with all parameters and response types, visit our API Documentation.
🏗️ Architecture
# @quec-wx-mp/api-ai
├── src/
│ ├── QuecPluginAI.ts # Core AI plugin class
│ ├── api.ts # API endpoint definitions
│ ├── const.ts # Constants
│ ├── index.ts # Entry point & exports
│ ├── tools.ts # Utility functions
│ └── modules/ # Feature modules
│ ├── buy.ts # Purchase & orders
│ ├── chat.ts # Chat management
│ ├── content.ts # Content services
│ ├── growth_baby.ts # Baby growth tracking
│ ├── mbti.ts # Personality system
│ ├── memory.ts # Memory operations
│ ├── voiceprint.ts # Voice recognition
│ ├── usage.ts # Usage tracking
│ ├── bot.ts # Bot configuration
│ ├── role.ts # Character roles
│ └── summary.ts # Summary generation
└── dist/ # Compiled output⚙️ Configuration
Build Commands
# Production build
npm run build
# Development build
npm run build-dev📝 License
MIT © Quectel
🔗 Links
📮 Support
For issues and questions:
- You can leave a message on the WeChat Official Accounts Platform
- Contact: [email protected]
Built with ❤️ by Quectel Clould Team
