What problem does it solve?
This Skill addresses the need for AI functionality in Node.js backend services and CloudBase cloud functions, allowing developers to integrate text generation, streaming, and image generation features seamlessly.
Core Features & Use Cases
- Text Generation: Create dynamic text based on given inputs for various applications like content creation and chatbots.
- Streaming: Stream text incrementally for real-time processing and applications.
- Image Generation: Generate images using built-in models like Hunyuan and DeepSeek.
- Use Case: Enhance your Node.js backend or CloudBase cloud function with AI-powered text generation for interactive chatbots or create custom image generation features for your application.
Quick Start
Integrate the ai-model-nodejs skill into your CloudBase cloud function to generate an image:
const tcb = require('@cloudbase/node-sdk');
const app = tcb.init({ env: '<YOUR_ENV_ID>' });
const ai = app.ai();
const imageModel = ai.createImageModel("hunyuan-image");
const res = await imageModel.generateImage({
model: "hunyuan-image",
prompt: "a serene landscape",
size: "1024x1024"
});
console.log(res.data[0].url);