ai-model-wechat

Generate and stream text from CloudBase AI models in WeChat Mini Programs.

72|5|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/TencentCloudBase/skills --skill ai-model-wechat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-model-wechat
Source: https://github.com/TencentCloudBase/skills/tree/main/skills/ai-model-wechat
Command: npx skills add https://github.com/TencentCloudBase/skills --skill ai-model-wechat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill makes it straightforward to integrate WeChat Mini Programs with CloudBase AI models, enabling AI-powered text generation and streaming directly in the mini program environment, without complex server setup.

Core Features & Use Cases

  • Text generation via wx.cloud.extend.AI using built-in models such as hunyuan-2.0-instruct-20251111 and deepseek-v3.2.
  • Streaming support with callbacks (onText, onEvent, onFinish) to display incremental AI responses in real time.
  • Demonstrated use cases include chat assistants in WeChat Mini Programs, customer support bots, and interactive help desks within enterprise apps.

Quick Start

  1. Initialize the WeChat cloud environment in your app with wx.cloud.init({ env: "<YOUR_ENV_ID>" }).
  2. Create an AI model instance: const model = wx.cloud.extend.AI.createModel("hunyuan-exp"); // or another supported provider
  3. Use generateText for non-streaming responses or streamText for streaming, following the examples in the skill guide.

Frequently Asked Questions about ai-model-wechat

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable AI text generation in a WeChat Mini Program?

To enable AI text generation in a WeChat Mini Program, initialize your cloud environment with wx.cloud.init, then create a model instance using wx.cloud.extend.AI.createModel. You can use built-in models like hunyuan or deepseek for text generation.

What is the best way to stream AI responses in a WeChat Mini Program?

Streaming AI responses in a WeChat Mini Program is best handled using the streamText function. It utilizes callbacks such as onText, onEvent, and onFinish to display incremental AI responses in real time within the app interface.

Does WeChat CloudBase support deepseek and hunyuan models for mini apps?

Yes, WeChat CloudBase supports both deepseek and hunyuan models for mini apps. The environment provides built-in access to hunyuan-2.0-instruct and deepseek-v3.2 models through the wx.cloud.extend.AI interface.

What WeChat base library version is required for CloudBase AI streaming?

CloudBase AI streaming requires WeChat base library version 3.7.1 or higher. Ensure your WeChat Mini Program or enterprise mini app meets this prerequisite before implementing the wx.cloud.extend.AI streaming callbacks.

Can I build a customer support chatbot in a WeChat enterprise mini app?

Yes, you can build a customer support chatbot in a WeChat enterprise mini app. The skill supports chat-like interactions and incremental text handling, making it suitable for interactive help desks and customer support bots.

Why use streamText instead of generateText for WeChat Mini Program AI chat?

Use streamText instead of generateText for WeChat Mini Program AI chat when you need real-time, incremental responses. streamText provides callbacks for onText and onFinish, whereas generateText returns the complete non-streaming response at once.