跳到正文
FunCoding

搜索

搜索文档、Skill 和 MCP

sn-image-base

Base-layer skill for the SenseNova-Skills project, providing low-level APIs for image generation, recognition (VLM), and text optimization (LLM). This skill does not preprocess inputs; it only calls backend services and returns results. This skill is not user-facing and is intended for upper-layer skills only.

文档与办公5.7kskills/sn-image-base/SKILL.md

安装

把这段话发给 Claude Code、Codex 或 Cursor。智能体会先检查安全性,你确认后才安装。

读取 https://funcoding.ai/skills/opensensenova/sensenova-skills/sn-image-base/install.md ,按里面的步骤帮我安装这个 Skill。

SKILL.md

sn-image-base

Dependency Installation

pip install -r requirements.txt

Overview

sn-image-base is the base-layer skill (tier 0) of the SenseNova-Skills project and provides four low-level tools:

  • sn-image-generate: image generation (calls text-to-image-no-enhance API)
  • sn-image-edit: image editing with SenseNova U1.5 Lite (calls /images/edits)
  • sn-image-recognize: image recognition (uses VLM to analyze image content)
  • sn-text-optimize: text optimization (uses LLM to process text)

This skill does not perform any input preprocessing and only calls backend services to return results.

Tools List

sn-image-generate

Image generation tool that calls the text-to-image-no-enhance API.

--prompt is required; all other parameters are optional:

ParameterTypeDefaultDescription
--promptstringRequiredPrompt text for image generation
--negative-promptstring""Negative prompt
--image-sizestring2kImage size preset (case-insensitive). Recommended: 2k. 4k is supported by sensenova-u1.5-lite; other SenseNova image models may reject it. Other values → status=failed.
--aspect-ratiostring16:9Aspect ratio, e.g. 1:1, 16:9, 9:16
--seedintNoneRandom seed for reproducible generation
--unet-namestringNoneSpecify a UNet model name
--api-keystringSN_IMAGE_GEN_API_KEY -> SN_API_KEYAPI key (CLI argument has priority; MissingApiKeyError is raised when all are empty)
--base-urlstringSN_IMAGE_GEN_BASE_URL -> SN_BASE_URLAPI base URL (CLI argument has priority)
--poll-intervalfloat5.0Polling interval (seconds)
--timeoutfloat300.0Timeout (seconds)
--insecureflagFalseDisable TLS verification
--save-pathPathAuto-generatedSave path

SenseNova image requests explicitly send watermark=false by default. Both sensenova-u1-fast and sensenova-u1.5-lite are supported; U1.5 Lite additionally supports native 4K output. This no-watermark feature is currently in free public beta and may become paid.

sn-image-edit

Edits one or more reference images with SenseNova U1.5 Lite through the /images/edits endpoint. Local paths are converted to Data URLs; HTTP(S) URLs and Data URLs are passed through.

python scripts/sn_agent_runner.py sn-image-edit \
    --prompt "Change the background to a snowy mountain" \
    --images source.png reference.png \
    --save-path edited.png

The edit request uses the official defaults n=1, size=auto, watermark=false, prompt_extend=true, and response_format=url.

sn-image-recognize

Image recognition tool that uses VLM (Vision Language Model) to analyze image content. Supports multiple image inputs.

--images and --user-prompt (or --user-prompt-path) are required. All other parameters use three-level defaults (CLI > env var > built-in default):

ParameterTypeBuilt-in DefaultEnv VarDescription
--api-keystringNo hardcoded defaultSN_VISION_API_KEY -> SN_CHAT_API_KEY -> SN_API_KEYChat runtime API key; raises MissingApiKeyError when all are unset
--base-urlstringSN_CHAT_BASE_URL defaultSN_VISION_BASE_URL -> SN_CHAT_BASE_URL -> SN_BASE_URLVision provider base URL; falls back to shared chat/global provider
--modelstringsensenova-6.8-flash-liteSN_VISION_MODEL -> SN_CHAT_MODELVision-capable model name
--vlm-typestringopenai-completionsSN_VISION_TYPE -> SN_CHAT_TYPEChat protocol type override
--user-prompt-pathstringNone-Local file path, mutually exclusive with --user-prompt
--system-prompt-pathstringNone-Local file path, mutually exclusive with --system-prompt

Available values for --vlm-type:

  • openai-completions: OpenAI-compatible /v1/chat/completions interface
  • anthropic-messages: Anthropic Messages /v1/messages interface

sn-text-optimize

Text optimization tool that uses LLM (Language Model) to optimize text content. Does not accept image inputs.

--user-prompt (or --user-prompt-path) is required. All other parameters use three-level defaults (CLI > env var > built-in default):

ParameterTypeBuilt-in DefaultEnv VarDescription
--api-keystringNo hardcoded defaultSN_TEXT_API_KEY -> SN_CHAT_API_KEY -> SN_API_KEYChat runtime API key; raises MissingApiKeyError when all are unset
--base-urlstringSN_CHAT_BASE_URL defaultSN_TEXT_BASE_URL -> SN_CHAT_BASE_URL -> SN_BASE_URLText provider base URL; falls back to shared chat/global provider
--modelstringsensenova-6.8-flash-liteSN_TEXT_MODEL -> SN_CHAT_MODELText model name
--llm-typestringopenai-completionsSN_TEXT_TYPE -> SN_CHAT_TYPEChat protocol type override
--user-prompt-pathstringNone-Local file path, mutually exclusive with --user-prompt
--system-prompt-pathstringNone-Local file path, mutually exclusive with --system-prompt

Available values for --llm-type:

  • openai-completions: OpenAI-compatible /v1/chat/completions interface
  • anthropic-messages: Anthropic Messages /v1/messages interface

VLM vs LLM

ToolModel TypeImage InputInterface Type Parameter
sn-image-recognizeVLM (Vision Language Model)Yes, supports multiple images--vlm-type
sn-text-optimizeLLM (Language Model)No, text only--llm-type

Usage

All tools are called through the unified sn_agent_runner.py entrypoint:

# Image generation (only prompt required; api-key/base-url have defaults)
python scripts/sn_agent_runner.py sn-image-generate \
    --prompt "..."

# Image generation (override base-url)
python scripts/sn_agent_runner.py sn-image-generate \
    --prompt "..." \
    --base-url "https://custom-endpoint.com/v1"

# Image generation (explicitly override api-key)
python scripts/sn_agent_runner.py sn-image-generate \
    --prompt "..." \
    --api-key "sk-xxx"

# Image recognition (VLM) - minimal call (uses built-in Sensenova defaults)
python scripts/sn_agent_runner.py sn-image-recognize \
    --user-prompt "Describe the image" \
    --images "path/to/image.png"

# Image recognition (VLM) - override to Anthropic Claude API compatible (messages interface)
python scripts/sn_agent_runner.py sn-image-recognize \
    --user-prompt "Describe the image" \
    --images "path/to/image.png" \
    --api-key "sk-ant-xxx" \
    --base-url "https://api.anthropic.com" \
    --model "claude-sonnet-4-6" \
    --vlm-type "anthropic-messages"

# Text optimization (LLM) - minimal call (uses built-in Sensenova defaults)
python scripts/sn_agent_runner.py sn-text-optimize \
    --user-prompt "Optimize the text: ..."

# Text optimization (LLM) - override to Anthropic Claude API compatible (messages interface)
python scripts/sn_agent_runner.py sn-text-optimize \
    --user-prompt "Optimize the text: ..." \
    --api-key "sk-ant-xxx" \
    --base-url "https://api.anthropic.com" \
    --model "claude-sonnet-4-6" \
    --llm-type "anthropic-messages"

Default Parameter Behavior

Authentication parameters for sn-image-generate have the following default behavior:

ParameterDefaultOverrideDescription
--base-urlSN_IMAGE_GEN_BASE_URL -> SN_BASE_URL--base-url "..."CLI argument has priority
--api-keySN_IMAGE_GEN_API_KEY -> SN_API_KEY--api-key "..."CLI argument has priority; throws MissingApiKeyError if all values are empty

sn-image-recognize and sn-text-optimize use priority: CLI argument > command-specific env var > shared SN_CHAT_* env var > global SN_* env var > built-in default.

ParameterBuilt-in DefaultVision Env VarText Env Var
--api-keyNone (must be provided)SN_VISION_API_KEY -> SN_CHAT_API_KEY -> SN_API_KEYSN_TEXT_API_KEY -> SN_CHAT_API_KEY -> SN_API_KEY
--base-urlhttps://token.sensenova.cn/v1SN_VISION_BASE_URL -> SN_CHAT_BASE_URL -> SN_BASE_URLSN_TEXT_BASE_URL -> SN_CHAT_BASE_URL -> SN_BASE_URL
--modelsensenova-6.8-flash-liteSN_VISION_MODEL -> SN_CHAT_MODELSN_TEXT_MODEL -> SN_CHAT_MODEL
--vlm-type / --llm-typeopenai-completionsSN_VISION_TYPE -> SN_CHAT_TYPESN_TEXT_TYPE -> SN_CHAT_TYPE

api_key resolution order (high to low): CLI --api-key > command-specific key (SN_VISION_API_KEY/SN_TEXT_API_KEY) > SN_CHAT_API_KEY > SN_API_KEY. If all are unset, MissingApiKeyError is raised.

Only --api-key must be provided via CLI or environment; base URL, model, and interface type have shared chat defaults.

Agent Configuration Integration

The agent can automatically read parameters from openclaw.json without manual input:

CLI Parameteropenclaw.json FieldExample
--base-urlproviders.<name>.baseUrlhttps://api.anthropic.com
--llm-typeproviders.<name>.apianthropic-messages / openai-completions
--vlm-typeproviders.<name>.apianthropic-messages / openai-completions
--modelproviders.<name>.models[].idclaude-sonnet-4-6
--api-keyproviders.<name>.apiKey or env varsk-cp-...

Note: --llm-type and --vlm-type share the same providers.<name>.api field and are used by LLM and VLM tools respectively.

Mapping between provider.api and interface type:

api ValueCorresponding --llm-type / --vlm-typeEndpoint Path
anthropic-messagesanthropic-messages/v1/messages
openai-completionsopenai-completions/v1/chat/completions
openai-responses(future extension)/responses

Mapping Between base-url and Interface Type

Different API types have different requirements for base-url format:

Type--llm-type / --vlm-typeRecommended base-urlCode Appended PathFinal URL Example
LLMopenai-completionshttps://token.sensenova.cn/v1/chat/completionshttps://token.sensenova.cn/v1/chat/completions
LLManthropic-messageshttps://api.anthropic.com/v1/messageshttps://api.anthropic.com/v1/messages
VLMopenai-completionshttps://token.sensenova.cn/v1/chat/completionshttps://token.sensenova.cn/v1/chat/completions
VLManthropic-messageshttps://api.anthropic.com/v1/messageshttps://api.anthropic.com/v1/messages

Note:

  • Recommended chat base URLs include the provider API version path, for example /v1.
  • For compatibility, if the configured chat base URL has no path, the runner appends /v1/chat/completions or /v1/messages.
  • If the configured chat base URL already has a path such as /v1, the runner appends only /chat/completions or /messages.
  • Some providers use versioned paths other than /v1, such as Gemini's /v1beta/openai.

Output Format

All tools support two output formats:

  • --output-format text (default): outputs plain text result
  • --output-format json: outputs JSON, including status and elapsed_seconds (runtime in seconds, rounded to 2 decimals)

JSON output for sn-image-recognize and sn-text-optimize also includes model, base_url, and interface_type to verify the effective runtime configuration:

{
  "status": "ok",
  "result": "...",
  "model": "sensenova-6.8-flash-lite",
  "base_url": "https://token.sensenova.cn/v1",
  "interface_type": "openai-completions",
  "elapsed_seconds": 1.23
}

On failure:

{
  "status": "failed",
  "error": "error message",
  "elapsed_seconds": 0.05
}

Input/Output Specification

See references/api_spec.md for details.

相似的 Skill

pdf
anthropics/skills180k

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.

文档与办公

discernment-nudge
anthropics/skills180k

discernment-nudge

After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.

文档与办公

doc-coauthoring
anthropics/skills180k

doc-coauthoring

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

文档与办公

docx
anthropics/skills180k

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.

文档与办公

pptx
anthropics/skills180k

pptx

Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.

文档与办公

canvas-design
anthropics/skills180k

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

文档与办公