Skip to main content

14 docs tagged with "AI"

View All Tags

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.

Add CloudBase AI (DeepSeek / Hunyuan) to Next.js

Use @cloudbase/node-sdk in a Next.js Route Handler to call CloudBase AI streamText, convert AsyncIterable to ReadableStream for the frontend, and consume the streaming response in a Client Component with fetch + getReader.

Deploy a Mastra TypeScript Agent to CloudBase Run

Write an agent and tools with Mastra 1.x, use mastra build to produce a Hono server, write a multi-stage Dockerfile, and deploy to CloudBase Run with tcb cloudrun deploy — including OpenAI key injection and CloudBase database tool integration.

Deploy an MCP Server to CloudBase Run

Write an MCP Server with @modelcontextprotocol/sdk + Hono that supports Streamable HTTP transport, package it with a multi-stage Dockerfile, deploy it to CloudBase Run via tcb cloudrun deploy, and connect Cursor / Claude Code / Windsurf directly via URL.

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.

Proxy Tavily AI Search via CloudBase Cloud Function

Use @tavily/core in a CloudBase Cloud Function to call the Tavily Search API, wrap real-time web retrieval for LLM agents into an HTTP-triggered function, and let frontends / Mini Programs call it directly without exposing the API key.