Add CloudBase AI (DeepSeek / Hunyuan) to a React Native App
RN 0.74+ mobile apps use a two-stage 'frontend fetch + backend proxy' pattern: a backend Route Handler (Next.js / Cloud Function / Cloud Run, your choice) uses @cloudbase/node-sdk's app.ai().createModel('cloudbase').streamText({model: 'deepseek-v4-flash'}) to return a text/plain streaming Response; the RN frontend reads the stream with fetch + body.getReader() (or react-native-fetch-api polyfill / XHR onprogress fallback) and renders text character by character in a FlatList. SecretId / SecretKey must never appear in the JS bundle — RN bundles are plaintext and can be decompiled by anyone.
Long Document Q&A with DeepSeek V4 1M-Token Context (No RAG)
Parse PDF / entire codebases / Excel files into plain text, feed the full content into the prompt, and call CloudBase AI streamText({ model: 'deepseek-v4-pro' }) to answer questions in one shot — skipping embeddings and vector databases, ideal for one-off long-document Q&A.
Multimodal Image Understanding with DeepSeek V4-Pro in CloudBase AI
A Next.js Route Handler receives user-uploaded images, converts them to base64, and calls @cloudbase/node-sdk's app.ai().createModel('cloudbase').generateText with model: 'deepseek-v4-pro' using multimodal messages to get image descriptions, OCR results, and content analysis. Covers single image, multiple images, and image + text prompts.