ai-model-cloudbase

Implements AI model calls via CloudBase SDKs, HTTP API, and WeChat Mini Program.

Updated May 14, 2026
One-click install
npx skills add https://github.com/study-yang/Vieb-Coding-- --skill ai-model-cloudbase-study-yang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-model-cloudbase
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-cloudbase
Command: npx skills add https://github.com/study-yang/Vieb-Coding-- --skill ai-model-cloudbase-study-yang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudbase/js-sdk, @cloudbase/node-sdk, openai.

What problem does it solve? Developers integrating AI capabilities into CloudBase-backed applications face inconsistent APIs across platforms—JS SDK, Node SDK, HTTP endpoints, and WeChat Mini Program each have different initialization, parameter structures, and return formats. This Skill provides the exact API shapes for each platform so you avoid integration errors. ## Core Features & Use Cases - Text Generation: Call generateText and streamText with the correct API shape for Web, Node.js, or WeChat Mini Program, including streaming callbacks and async iteration. - Image Generation: Generate images with the Hunyuan image model via the Node SDK, with control over size, style, seed, and watermark. - HTTP & OpenAI-Compatible Access: Call CloudBase AI endpoints directly via cURL or the OpenAI SDK for any platform. - Use Case: Building a WeChat Mini Program chatbot? Follow Part 3 to wrap streamText parameters in the required data object and handle the [DONE] event correctly. ## Quick Start Ask the AI to implement streaming text generation with the hunyuan-lite model in your WeChat Mini Program using CloudBase.

Frequently Asked Questions about ai-model-cloudbase

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

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

Use wx.cloud.extend.AI.createModel after calling wx.cloud.init with your environment ID. For streaming, wrap parameters in a data object and use onText, onEvent, and onFinish callbacks, or iterate res.textStream.

How to stream text responses with the CloudBase Node SDK?

Call model.streamText with your model name and messages, then iterate res.textStream with for-await to receive incremental text chunks. You can also await res.usage and res.messages for final token counts and history.

What is the difference between CloudBase JS SDK and WeChat Mini Program AI APIs?

The JS SDK returns wrapped results like { text, usage, messages }, while the Mini Program returns raw OpenAI-style responses with a choices array. Mini Program streamText also requires parameters wrapped in a data object and supports callbacks.

Can I generate images with CloudBase AI in the browser or Mini Program?

No, image generation with hunyuan-image is only available in the Node SDK version 3.16.0 or above. It is not supported in the JS SDK for browsers or in WeChat Mini Programs.

Does CloudBase AI work with the OpenAI SDK?

Yes, point the OpenAI SDK baseURL to https://<ENV_ID>.api.tcloudbasegateway.com/v1/ai/<PROVIDER>/v1 and use your API key. Both streaming and non-streaming chat completions are supported.

Why does my WeChat Mini Program streamText call fail?

The most common cause is missing the required data wrapper around model and messages parameters. Also verify your base library is version 3.7.1 or above and that wx.cloud.init was called with the correct environment ID.