ai-model-nodejs
Use this skill for Node.js backend AI via @cloudbase/node-sdk (>=3.16.0) — cloud functions, CloudRun, Express/Koa/NestJS,…
Use this skill for WeChat Mini Program AI via wx.cloud.extend.AI (小程序, wx.cloud apps). Covers generateText and streamText with callbacks (onText, onEvent, onFinish); streamText needs a data wrapper, generateText returns the raw response. Models via wx.cloud.extend.AI.createModel
$ npx -y skills add tencentcloudbase/awesome-cloudbase-examples --skill ai-model-wechat --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ai-model-wechatContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill for WeChat Mini Program AI via wx.cloud.extend.AI (小程序, wx.cloud apps). Covers generateText and streamText with callbacks (onText, onEvent, onFinish); streamText needs a data wrapper, generateText returns the raw response. Models via wx.cloud.extend.AI.createModel
name: ai-model-wechat description: "Use this skill for WeChat Mini Program AI via wx.cloud.extend.AI (小程序, wx.cloud apps). Covers generateText and streamText with callbacks (onText, onEvent, onFinish); streamText needs a data wrapper, generateText returns the raw response. Models via wx.cloud.extend.AI.createModel with groups cloudbase (main managed, also 小程序成长计划 with `hy3`), the legacy hunyuan-v3 / hunyuan-exp, or custom-*; model id goes in the data wrapper `model` field. MUST run two-step preflight before code — see body. NOT for browser/Web (use ai-model-web), Node.js backend (use ai-model-nodejs), or image generation (use ai-model-nodejs)." version: 2.36.1 license: MIT alwaysApply: false
Sibling CloudBase skills ship beside this skill. Use local relative paths such as `../auth-tool-cloudbase/SKILL.md`.
If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do **not** HTTP-fetch remote skill or protocol markdown into the agent context.
Use this skill for **calling AI models in WeChat Mini Program** using `wx.cloud.extend.AI`.
**Use it when you need to:**
**Do NOT use for:**
---
Read this before writing any `createModel(...)` line. Agents frequently hallucinate this argument. There are **exactly four** legal shapes. Anything else is a bug.
| ✅ Legal `createModel(provider)` argument | When to use it | |-----------------------------------------|----------------| | `"cloudbase"` | **Default, including 小程序成长计划.** Main managed group (TokenHub-backed, multi-vendor pool). Growth Plan quota draws on `cloudbase` + `hy3` — enable `hy3` first. Vendor + concrete model go into the **`model` field**, e.g. `{ model: "deepseek-v4-flash" }`. | | `"hunyuan-v3"` | **Legacy plan group, being retired.** Only `hy3` is available and no new models are added. Existing plan-enrolled code keeps working; new code uses `cloudbase` + `hy3`. | | `"hunyuan-exp"` | Older legacy builtin group — only if `DescribeAIModels` still returns it. Its default `hunyuan-2.0-instruct-20251111` went **offline on 2026-05-31**; never target that id. | | `"custom-<your-name>"` | A user-defined GroupName you onboarded via `CreateAIModel`. **Must** start with `custom-` (e.g. `custom-kimi`, `custom-openai-compat`). |
wx.cloud.extend.AI.createModel("deepseek") // wrong — vendor, not GroupName
wx.cloud.extend.AI.createModel("deepseek-v4-flash") // wrong — model id goes in `model`
wx.cloud.extend.AI.createModel("hunyuan") // wrong — vendor family
wx.cloud.extend.AI.createModel("hunyuan-2.0-instruct-20251111") // wrong — model name
wx.cloud.extend.AI.createModel("glm") / "kimi" / "minimax" // wrong — vendor names
wx.cloud.extend.AI.createModel("custom") // wrong — placeholder
wx.cloud.extend.AI.createModel(modelName) // wrong — do not reuse the model-id variable// Growth Plan branch (enable hy3 in the console first)
const model = wx.cloud.extend.AI.createModel("cloudbase"); // ← provider / GroupName
await model.streamText({
data: { model: "hy3", messages: [...] } // ← concrete model id
});
// Token Credits branch
const model = wx.cloud.extend.AI.createModel("cloudbase");
await model.streamText({
data: { model: "deepseek-v4-flash", messages: [...] }
});1. The user says "use DeepSeek v3.2" / "use hunyuan thinking" / "use Kimi k2.6" / … 2. First run the eligibility decision tree below — the provider is `"cloudbase"` in almost every case, including Growth Plan environments (`cloudbase` + `hy3`). `"hunyuan-v3"` only appears in existing code that already used it; `"hunyuan-exp"` only if `DescribeAIModels` still returns that older group. 3. Put the model id into the **`model` field** inside `data`: `{ model: "deepseek-v3.2" }`, `{ model: "hy3" }`, `{ model: "kimi-k2.6" }`, … 4. Before using the model id, make sure it is present in `DescribeAIModels({ GroupName: "cloudbase" }).Models[]`. If not, enable it via `UpdateAIModel`.
> If you are about to type `wx.cloud.extend.AI.createModel(` and the thing inside the parentheses is a vendor name or a model id — **stop**. It is almost certainly one of the four legal values above.
---
You MUST NOT jump straight into `wx.cloud.extend.AI.createModel(...)`. Before writing any business code, confirm **billing eligibility** and **group readiness** in this fixed order: **① eligibility → ② group readiness**. Do not swap the two.
The Mini Program side has two billing paths: **小程序成长计划** (checked first) and **Token Credits 资源包** (generic fallback). Both settle through the `cloudbase` main managed group — on the plan, the model is `hy3` and the plan quota is drawn first; `hunyuan-v3` is the legacy plan group that only draws plan quota and is being retired.
1. Fetch `envId` via the MCP tool `queryEnv action=info`.
2. Pick the branch by user intent:
| User intent | Eligibility to check first | `createModel` provider on hit | Model selection | Guidance on miss | |-----
精选的腾讯云开发(Tencent CloudBase,TCB)示例项目和资源列表 云开发(Tencent CloudBase,TCB) 是腾讯云提供的云原生一体化开发环境和工具平台,为开发者提供高可用、自动弹性扩缩的后端云服务,包含计算、存储、托管等能力,可用于构建多种应用场景下的应用系统。
Use this skill for Node.js backend AI via @cloudbase/node-sdk (>=3.16.0) — cloud functions, CloudRun, Express/Koa/NestJS,…
CloudBase Node SDK auth guide for server-side identity, user lookup, and custom login tickets. This skill should be used when…
CloudBase auth provider configuration and login-readiness guide. This skill should be used when users need to inspect, enable,…
CloudBase WeChat Mini Program native authentication guide. This skill should be used when users need mini program identity…
Operate Tencent Cloud control-plane resources (monitoring/alarms, CLB, CAM roles, COS, MySQL, SCF) via cloud APIs when no…
CloudBase function runtime guide for building, deploying, and debugging your own Event Functions or HTTP Functions. This skill…