ai-model-wechat

Integrate AI text generation into WeChat Mini Programs via wx.cloud.extend.AI.

Updated May 14, 2026
One-click install
npx skills add https://github.com/study-yang/Vieb-Coding-- --skill ai-model-wechat-study-yang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-model-wechat
Source: https://github.com/study-yang/Vieb-Coding--/tree/main/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F-%E5%BF%AB%E8%AE%B0/.codebuddy/skills/ai-model-wechat
Command: npx skills add https://github.com/study-yang/Vieb-Coding-- --skill ai-model-wechat-study-yang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Calling AI models from a WeChat Mini Program involves confusing provider/model semantics, billing eligibility checks, and API differences from the JS/Node SDK, which frequently cause hallucinated code and runtime failures. ## Core Features & Use Cases - Correct createModel usage: Enforces the three legal provider values (hunyuan-exp, cloudbase, custom-*) and keeps model IDs in the data.model field. - Mandatory two-step preflight: Verifies billing eligibility (小程序成长计划 or Token Credits pack) and group readiness via DescribeAIModels/UpdateAIModel before writing business code. - Streaming and non-streaming calls: Covers generateText (raw response) and streamText (data wrapper, onText/onEvent/onFinish callbacks, [DONE] handling). - Use Case: A developer building a Mini Program chat assistant uses this Skill to check 成长计划 enrollment, enable deepseek-v4-flash in the cloudbase group, and implement streaming replies with onText callbacks. ## Quick Start Use the ai-model-wechat skill to add a streaming AI chat feature to my WeChat Mini Program using wx.cloud.extend.AI.

Frequently Asked Questions about ai-model-wechat

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

FAQPage Schema
How do I call AI models in a WeChat Mini Program?

Use wx.cloud.extend.AI.createModel with a valid GroupName (hunyuan-exp, cloudbase, or a custom-* group), then call generateText or streamText with the model ID in the model field. WeChat base library 3.7.1 or higher is required.

How to stream AI responses in a WeChat Mini Program?

Call model.streamText with parameters wrapped in a data object, and use onText, onEvent, and onFinish callbacks for incremental updates. You can also iterate res.textStream, and stop the eventStream only when event.data equals [DONE].

What is the difference between wx.cloud.extend.AI and the JS/Node SDK?

The Mini Program API wraps streamText parameters in a data object, returns raw responses from generateText instead of a wrapped object, supports callbacks, and does not support image generation. The namespace is wx.cloud.extend.AI instead of app.ai().

Why does createModel("deepseek") fail in my Mini Program?

createModel accepts only a GroupName, not a vendor or model name. Use createModel("cloudbase") and pass the model ID like deepseek-v4-flash in the data.model field, after enabling it via DescribeAIModels and UpdateAIModel.

Can I use Hunyuan models without the Mini Program growth plan?

No, hunyuan-* models require enrollment in the 小程序成长计划 (ai_miniprogram_inspire_plan), verified via DescribeActivityInfo. Without enrollment, switch to the cloudbase group with a non-hunyuan model backed by a Token Credits resource pack.