[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D8QSHTEAGCM0625JC163Y9":3,"skill-same:01M7D8QSHTEAGCM0625JC163Y9":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M7D8QSHTEAGCM0625JC163Y9","VLM",null,"Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images, describe visual content, or create applications that combine image understanding with conversational AI. Supports image URLs and base64 encoded images for multimodal interactions.","nordeim\u002Factivity-map","nordeim","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F194583642?v=4","01M75CZEV8C3V4DDQNPQ1EA7QJ","01M7D8P5VVNEK50A7DQ421HDCN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002FVLM\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002FVLM\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: VLM\ndescription: Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images, describe visual content, or create applications that combine image understanding with conversational AI. Supports image URLs and base64 encoded images for multimodal interactions.\nlicense: MIT\n---\n\n# VLM(Vision Chat) Skill\n\nThis skill guides the implementation of vision chat functionality using the z-ai-web-dev-sdk package, enabling AI models to understand and respond to images combined with text prompts.\n\n## Skills Path\n\n**Skill Location**: `{project_path}\u002Fskills\u002FVLM`\n\nthis skill is located at above path in your project.\n\n**Reference Scripts**: Example test scripts are available in the `{Skill Location}\u002Fscripts\u002F` directory for quick testing and reference. See `{Skill Location}\u002Fscripts\u002Fvlm.ts` for a working example.\n\n## Overview\n\nVision Chat allows you to build applications that can analyze images, extract information from visual content, and answer questions about images through natural language conversation.\n\n**IMPORTANT**: z-ai-web-dev-sdk MUST be used in backend code only. Never use it in client-side code.\n\n## Prerequisites\n\nThe z-ai-web-dev-sdk package is already installed. Import it as shown in the examples below.\n\n## CLI Usage (For Simple Tasks)\n\nFor simple image analysis tasks, you can use the z-ai CLI instead of writing code. This is ideal for quick image descriptions, testing vision capabilities, or simple automation.\n\n### Basic Image Analysis\n\n```bash\n# Describe an image from URL\nz-ai vision --prompt \"What's in this image?\" --image \"https:\u002F\u002Fexample.com\u002Fphoto.jpg\"\n\n# Using short options\nz-ai vision -p \"Describe this image\" -i \"https:\u002F\u002Fexample.com\u002Fimage.png\"\n```\n\n### Analyze Local Images\n\n```bash\n# Analyze a local image file\nz-ai vision -p \"What objects are in this photo?\" -i \".\u002Fphoto.jpg\"\n\n# Save response to file\nz-ai vision -p \"Describe the scene\" -i \".\u002Flandscape.png\" -o description.json\n```\n\n### Multiple Images\n\n```bash\n# Analyze multiple images at once\nz-ai vision \\\n  -p \"Compare these two images\" \\\n  -i \".\u002Fphoto1.jpg\" \\\n  -i \".\u002Fphoto2.jpg\" \\\n  -o comparison.json\n\n# Multiple images with detailed analysis\nz-ai vision \\\n  --prompt \"What are the differences between these images?\" \\\n  --image \"https:\u002F\u002Fexample.com\u002Fbefore.jpg\" \\\n  --image \"https:\u002F\u002Fexample.com\u002Fafter.jpg\"\n```\n\n### With Thinking (Chain of Thought)\n\n```bash\n# Enable thinking for complex visual reasoning\nz-ai vision \\\n  -p \"Count the number of people in this image and describe their activities\" \\\n  -i \".\u002Fcrowd.jpg\" \\\n  --thinking \\\n  -o analysis.json\n```\n\n### Streaming Output\n\n```bash\n# Stream the vision analysis\nz-ai vision -p \"Describe this image in detail\" -i \".\u002Fphoto.jpg\" --stream\n```\n\n### CLI Parameters\n\n- `--prompt, -p \u003Ctext>`: **Required** - Question or instruction about the image(s)\n- `--image, -i \u003CURL or path>`: Optional - Image URL or local file path (can be used multiple times)\n- `--thinking, -t`: Optional - Enable chain-of-thought reasoning (default: disabled)\n- `--output, -o \u003Cpath>`: Optional - Output file path (JSON format)\n- `--stream`: Optional - Stream the response in real-time\n\n### Supported Image Formats\n\n- PNG (.png)\n- JPEG (.jpg, .jpeg)\n- GIF (.gif)\n- WebP (.webp)\n- BMP (.bmp)\n\n### When to Use CLI vs SDK\n\n**Use CLI for:**\n- Quick image analysis\n- Testing vision model capabilities\n- One-off image descriptions\n- Simple automation scripts\n\n**Use SDK for:**\n- Multi-turn conversations with images\n- Dynamic image analysis in applications\n- Batch processing with custom logic\n- Production applications with complex workflows\n\n## Recommended Approach\n\nFor better performance and reliability, use base64 encoding to pass images to the model instead of image URLs.\n\n## Supported Content Types\n\nThe Vision Chat API supports three types of media content:\n\n### 1. **image_url** - For Image Files\nUse this type for static images (PNG, JPEG, GIF, WebP, etc.)\n```typescript\n{\n    role: 'user',\n    content: [\n        { type: 'text', text: prompt },\n        { type: 'image_url', image_url: { url: imageUrl } }\n    ]\n}\n```\n\n### 2. **video_url** - For Video Files\nUse this type for video content (MP4, AVI, MOV, etc.)\n```typescript\n{\n    role: 'user',\n    content: [\n        { type: 'text', text: prompt },\n        { type: 'video_url', video_url: { url: videoUrl } }\n    ]\n}\n```\n\n### 3. **file_url** - For Document Files\nUse this type for document files (PDF, DOCX, TXT, etc.)\n```typescript\n{\n    role: 'user',\n    content: [\n        { type: 'text', text: prompt },\n        { type: 'file_url', file_url: { url: fileUrl } }\n    ]\n}\n```\n\n**Note**: You can combine multiple content types in a single message. For example, you can include both text and multiple images, or text with both an image and a document.\n\n## Basic Vision Chat Implementation\n\n### Single Image Analysis\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nasync function analyzeImage(imageUrl, question) {\n  const zai = await ZAI.create();\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: [\n          {\n            type: 'text',\n            text: question\n          },\n          {\n            type: 'image_url',\n            image_url: {\n              url: imageUrl\n            }\n          }\n        ]\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  return response.choices[0]?.message?.content;\n}\n\n\u002F\u002F Usage\nconst result = await analyzeImage(\n  'https:\u002F\u002Fexample.com\u002Fproduct.jpg',\n  'Describe this product in detail'\n);\nconsole.log('Analysis:', result);\n```\n\n### Multiple Images Analysis\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nasync function compareImages(imageUrls, question) {\n  const zai = await ZAI.create();\n\n  const content = [\n    {\n      type: 'text',\n      text: question\n    },\n    ...imageUrls.map(url => ({\n      type: 'image_url',\n      image_url: { url }\n    }))\n  ];\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: content\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  return response.choices[0]?.message?.content;\n}\n\n\u002F\u002F Usage\nconst comparison = await compareImages(\n  [\n    'https:\u002F\u002Fexample.com\u002Fbefore.jpg',\n    'https:\u002F\u002Fexample.com\u002Fafter.jpg'\n  ],\n  'Compare these two images and describe the differences'\n);\n```\n\n### Base64 Image Support\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\nimport fs from 'fs';\n\nasync function analyzeLocalImage(imagePath, question) {\n  const zai = await ZAI.create();\n\n  \u002F\u002F Read image file and convert to base64\n  const imageBuffer = fs.readFileSync(imagePath);\n  const base64Image = imageBuffer.toString('base64');\n  const mimeType = imagePath.endsWith('.png') ? 'image\u002Fpng' : 'image\u002Fjpeg';\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: [\n          {\n            type: 'text',\n            text: question\n          },\n          {\n            type: 'image_url',\n            image_url: {\n              url: `data:${mimeType};base64,${base64Image}`\n            }\n          }\n        ]\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  return response.choices[0]?.message?.content;\n}\n```\n\n## Advanced Use Cases\n\n### Conversational Vision Chat\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nclass VisionChatSession {\n  constructor() {\n    this.messages = [];\n  }\n\n  async initialize() {\n    this.zai = await ZAI.create();\n  }\n\n  async addImage(imageUrl, initialQuestion) {\n    this.messages.push({\n      role: 'user',\n      content: [\n        {\n          type: 'text',\n          text: initialQuestion\n        },\n        {\n          type: 'image_url',\n          image_url: { url: imageUrl }\n        }\n      ]\n    });\n\n    return this.getResponse();\n  }\n\n  async followUp(question) {\n    this.messages.push({\n      role: 'user',\n      content: [\n        {\n          type: 'text',\n          text: question\n        }\n      ]\n    });\n\n    return this.getResponse();\n  }\n\n  async getResponse() {\n    const response = await this.zai.chat.completions.createVision({\n      messages: this.messages,\n      thinking: { type: 'disabled' }\n    });\n\n    const assistantMessage = response.choices[0]?.message?.content;\n    \n    this.messages.push({\n      role: 'assistant',\n      content: assistantMessage\n    });\n\n    return assistantMessage;\n  }\n}\n\n\u002F\u002F Usage\nconst session = new VisionChatSession();\nawait session.initialize();\n\nconst initial = await session.addImage(\n  'https:\u002F\u002Fexample.com\u002Fchart.jpg',\n  'What does this chart show?'\n);\nconsole.log('Initial analysis:', initial);\n\nconst followup = await session.followUp('What are the key trends?');\nconsole.log('Follow-up:', followup);\n```\n\n### Image Classification and Tagging\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nasync function classifyImage(imageUrl) {\n  const zai = await ZAI.create();\n\n  const prompt = `Analyze this image and provide:\n1. Main subject\u002Fcategory\n2. Key objects detected\n3. Scene description\n4. Suggested tags (comma-separated)\n\nFormat your response as JSON.`;\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: [\n          {\n            type: 'text',\n            text: prompt\n          },\n          {\n            type: 'image_url',\n            image_url: { url: imageUrl }\n          }\n        ]\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  const content = response.choices[0]?.message?.content;\n  \n  try {\n    return JSON.parse(content);\n  } catch (e) {\n    return { rawResponse: content };\n  }\n}\n```\n\n### OCR and Text Extraction\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nasync function extractText(imageUrl) {\n  const zai = await ZAI.create();\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: [\n          {\n            type: 'text',\n            text: 'Extract all text from this image. Preserve the layout and formatting as much as possible.'\n          },\n          {\n            type: 'image_url',\n            image_url: { url: imageUrl }\n          }\n        ]\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  return response.choices[0]?.message?.content;\n}\n```\n\n## Best Practices\n\n### 1. Image Quality and Size\n- Use high-quality images for better analysis results\n- Optimize image size to balance quality and processing speed\n- Supported formats: JPEG, PNG, WebP\n\n### 2. Prompt Engineering\n- Be specific about what information you need from the image\n- Structure complex requests with numbered lists or bullet points\n- Provide context about the image type (photo, diagram, chart, etc.)\n\n### 3. Error Handling\n```javascript\nasync function safeVisionChat(imageUrl, question) {\n  try {\n    const zai = await ZAI.create();\n    \n    const response = await zai.chat.completions.createVision({\n      messages: [\n        {\n          role: 'user',\n          content: [\n            { type: 'text', text: question },\n            { type: 'image_url', image_url: { url: imageUrl } }\n          ]\n        }\n      ],\n      thinking: { type: 'disabled' }\n    });\n\n    return {\n      success: true,\n      content: response.choices[0]?.message?.content\n    };\n  } catch (error) {\n    console.error('Vision chat error:', error);\n    return {\n      success: false,\n      error: error.message\n    };\n  }\n}\n```\n\n### 4. Performance Optimization\n- Cache SDK instance creation when processing multiple images\n- Use appropriate image formats (JPEG for photos, PNG for diagrams)\n- Consider image preprocessing for large batches\n\n### 5. Security Considerations\n- Validate image URLs before processing\n- Sanitize user-provided image data\n- Implement rate limiting for public-facing APIs\n- Never expose SDK credentials in client-side code\n\n## Common Use Cases\n\n1. **Product Analysis**: Analyze product images for e-commerce applications\n2. **Document Understanding**: Extract information from receipts, invoices, forms\n3. **Medical Imaging**: Assist in preliminary analysis (with appropriate disclaimers)\n4. **Quality Control**: Detect defects or anomalies in manufacturing\n5. **Content Moderation**: Analyze images for policy compliance\n6. **Accessibility**: Generate alt text for images automatically\n7. **Visual Search**: Understand and categorize images for search functionality\n\n## Integration Examples\n\n### Express.js API Endpoint\n\n```javascript\nimport express from 'express';\nimport ZAI from 'z-ai-web-dev-sdk';\n\nconst app = express();\napp.use(express.json());\n\nlet zaiInstance;\n\n\u002F\u002F Initialize SDK once\nasync function initZAI() {\n  zaiInstance = await ZAI.create();\n}\n\napp.post('\u002Fapi\u002Fanalyze-image', async (req, res) => {\n  try {\n    const { imageUrl, question } = req.body;\n\n    if (!imageUrl || !question) {\n      return res.status(400).json({ \n        error: 'imageUrl and question are required' \n      });\n    }\n\n    const response = await zaiInstance.chat.completions.createVision({\n      messages: [\n        {\n          role: 'user',\n          content: [\n            { type: 'text', text: question },\n            { type: 'image_url', image_url: { url: imageUrl } }\n          ]\n        }\n      ],\n      thinking: { type: 'disabled' }\n    });\n\n    res.json({\n      success: true,\n      analysis: response.choices[0]?.message?.content\n    });\n  } catch (error) {\n    res.status(500).json({\n      success: false,\n      error: error.message\n    });\n  }\n});\n\ninitZAI().then(() => {\n  app.listen(3000, () => {\n    console.log('Vision chat API running on port 3000');\n  });\n});\n```\n\n## Troubleshooting\n\n**Issue**: \"SDK must be used in backend\"\n- **Solution**: Ensure z-ai-web-dev-sdk is only imported and used in server-side code\n\n**Issue**: Image not loading or being analyzed\n- **Solution**: Verify the image URL is accessible and returns a valid image format\n\n**Issue**: Poor analysis quality\n- **Solution**: Provide more specific prompts and ensure image quality is sufficient\n\n**Issue**: Slow response times\n- **Solution**: Optimize image size and consider caching frequently analyzed images\n\n## Remember\n\n- Always use z-ai-web-dev-sdk in backend code only\n- The SDK is already installed - import as shown in examples\n- Structure prompts clearly for best results\n- Handle errors gracefully in production applications\n- Consider user privacy when processing images\n","# VLM(Vision Chat) Skill\n\nThis skill guides the implementation of vision chat functionality using the z-ai-web-dev-sdk package, enabling AI models to understand and respond to images combined with text prompts.\n\n## Skills Path\n\n**Skill Location**: `{project_path}\u002Fskills\u002FVLM`\n\nthis skill is located at above path in your project.\n\n**Reference Scripts**: Example test scripts are available in the `{Skill Location}\u002Fscripts\u002F` directory for quick testing and reference. See `{Skill Location}\u002Fscripts\u002Fvlm.ts` for a working example.\n\n## Overview\n\nVision Chat allows you to build applications that can analyze images, extract information from visual content, and answer questions about images through natural language conversation.\n\n**IMPORTANT**: z-ai-web-dev-sdk MUST be used in backend code only. Never use it in client-side code.\n\n## Prerequisites\n\nThe z-ai-web-dev-sdk package is already installed. Import it as shown in the examples below.\n\n## CLI Usage (For Simple Tasks)\n\nFor simple image analysis tasks, you can use the z-ai CLI instead of writing code. This is ideal for quick image descriptions, testing vision capabilities, or simple automation.\n\n### Basic Image Analysis\n\n```bash\n# Describe an image from URL\nz-ai vision --prompt \"What's in this image?\" --image \"https:\u002F\u002Fexample.com\u002Fphoto.jpg\"\n\n# Using short options\nz-ai vision -p \"Describe this image\" -i \"https:\u002F\u002Fexample.com\u002Fimage.png\"\n```\n\n### Analyze Local Images\n\n```bash\n# Analyze a local image file\nz-ai vision -p \"What objects are in this photo?\" -i \".\u002Fphoto.jpg\"\n\n# Save response to file\nz-ai vision -p \"Describe the scene\" -i \".\u002Flandscape.png\" -o description.json\n```\n\n### Multiple Images\n\n```bash\n# Analyze multiple images at once\nz-ai vision \\\n  -p \"Compare these two images\" \\\n  -i \".\u002Fphoto1.jpg\" \\\n  -i \".\u002Fphoto2.jpg\" \\\n  -o comparison.json\n\n# Multiple images with detailed analysis\nz-ai vision \\\n  --prompt \"What are the differences between these images?\" \\\n  --image \"https:\u002F\u002Fexample.com\u002Fbefore.jpg\" \\\n  --image \"https:\u002F\u002Fexample.com\u002Fafter.jpg\"\n```\n\n### With Thinking (Chain of Thought)\n\n```bash\n# Enable thinking for complex visual reasoning\nz-ai vision \\\n  -p \"Count the number of people in this image and describe their activities\" \\\n  -i \".\u002Fcrowd.jpg\" \\\n  --thinking \\\n  -o analysis.json\n```\n\n### Streaming Output\n\n```bash\n# Stream the vision analysis\nz-ai vision -p \"Describe this image in detail\" -i \".\u002Fphoto.jpg\" --stream\n```\n\n### CLI Parameters\n\n- `--prompt, -p \u003Ctext>`: **Required** - Question or instruction about the image(s)\n- `--image, -i \u003CURL or path>`: Optional - Image URL or local file path (can be used multiple times)\n- `--thinking, -t`: Optional - Enable chain-of-thought reasoning (default: disabled)\n- `--output, -o \u003Cpath>`: Optional - Output file path (JSON format)\n- `--stream`: Optional - Stream the response in real-time\n\n### Supported Image Formats\n\n- PNG (.png)\n- JPEG (.jpg, .jpeg)\n- GIF (.gif)\n- WebP (.webp)\n- BMP (.bmp)\n\n### When to Use CLI vs SDK\n\n**Use CLI for:**\n- Quick image analysis\n- Testing vision model capabilities\n- One-off image descriptions\n- Simple automation scripts\n\n**Use SDK for:**\n- Multi-turn conversations with images\n- Dynamic image analysis in applications\n- Batch processing with custom logic\n- Production applications with complex workflows\n\n## Recommended Approach\n\nFor better performance and reliability, use base64 encoding to pass images to the model instead of image URLs.\n\n## Supported Content Types\n\nThe Vision Chat API supports three types of media content:\n\n### 1. **image_url** - For Image Files\nUse this type for static images (PNG, JPEG, GIF, WebP, etc.)\n```typescript\n{\n    role: 'user',\n    content: [\n        { type: 'text', text: prompt },\n        { type: 'image_url', image_url: { url: imageUrl } }\n    ]\n}\n```\n\n### 2. **video_url** - For Video Files\nUse this type for video content (MP4, AVI, MOV, etc.)\n```typescript\n{\n    role: 'user',\n    content: [\n        { type: 'text', text: prompt },\n        { type: 'video_url', video_url: { url: videoUrl } }\n    ]\n}\n```\n\n### 3. **file_url** - For Document Files\nUse this type for document files (PDF, DOCX, TXT, etc.)\n```typescript\n{\n    role: 'user',\n    content: [\n        { type: 'text', text: prompt },\n        { type: 'file_url', file_url: { url: fileUrl } }\n    ]\n}\n```\n\n**Note**: You can combine multiple content types in a single message. For example, you can include both text and multiple images, or text with both an image and a document.\n\n## Basic Vision Chat Implementation\n\n### Single Image Analysis\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nasync function analyzeImage(imageUrl, question) {\n  const zai = await ZAI.create();\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: [\n          {\n            type: 'text',\n            text: question\n          },\n          {\n            type: 'image_url',\n            image_url: {\n              url: imageUrl\n            }\n          }\n        ]\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  return response.choices[0]?.message?.content;\n}\n\n\u002F\u002F Usage\nconst result = await analyzeImage(\n  'https:\u002F\u002Fexample.com\u002Fproduct.jpg',\n  'Describe this product in detail'\n);\nconsole.log('Analysis:', result);\n```\n\n### Multiple Images Analysis\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nasync function compareImages(imageUrls, question) {\n  const zai = await ZAI.create();\n\n  const content = [\n    {\n      type: 'text',\n      text: question\n    },\n    ...imageUrls.map(url => ({\n      type: 'image_url',\n      image_url: { url }\n    }))\n  ];\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: content\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  return response.choices[0]?.message?.content;\n}\n\n\u002F\u002F Usage\nconst comparison = await compareImages(\n  [\n    'https:\u002F\u002Fexample.com\u002Fbefore.jpg',\n    'https:\u002F\u002Fexample.com\u002Fafter.jpg'\n  ],\n  'Compare these two images and describe the differences'\n);\n```\n\n### Base64 Image Support\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\nimport fs from 'fs';\n\nasync function analyzeLocalImage(imagePath, question) {\n  const zai = await ZAI.create();\n\n  \u002F\u002F Read image file and convert to base64\n  const imageBuffer = fs.readFileSync(imagePath);\n  const base64Image = imageBuffer.toString('base64');\n  const mimeType = imagePath.endsWith('.png') ? 'image\u002Fpng' : 'image\u002Fjpeg';\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: [\n          {\n            type: 'text',\n            text: question\n          },\n          {\n            type: 'image_url',\n            image_url: {\n              url: `data:${mimeType};base64,${base64Image}`\n            }\n          }\n        ]\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  return response.choices[0]?.message?.content;\n}\n```\n\n## Advanced Use Cases\n\n### Conversational Vision Chat\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nclass VisionChatSession {\n  constructor() {\n    this.messages = [];\n  }\n\n  async initialize() {\n    this.zai = await ZAI.create();\n  }\n\n  async addImage(imageUrl, initialQuestion) {\n    this.messages.push({\n      role: 'user',\n      content: [\n        {\n          type: 'text',\n          text: initialQuestion\n        },\n        {\n          type: 'image_url',\n          image_url: { url: imageUrl }\n        }\n      ]\n    });\n\n    return this.getResponse();\n  }\n\n  async followUp(question) {\n    this.messages.push({\n      role: 'user',\n      content: [\n        {\n          type: 'text',\n          text: question\n        }\n      ]\n    });\n\n    return this.getResponse();\n  }\n\n  async getResponse() {\n    const response = await this.zai.chat.completions.createVision({\n      messages: this.messages,\n      thinking: { type: 'disabled' }\n    });\n\n    const assistantMessage = response.choices[0]?.message?.content;\n    \n    this.messages.push({\n      role: 'assistant',\n      content: assistantMessage\n    });\n\n    return assistantMessage;\n  }\n}\n\n\u002F\u002F Usage\nconst session = new VisionChatSession();\nawait session.initialize();\n\nconst initial = await session.addImage(\n  'https:\u002F\u002Fexample.com\u002Fchart.jpg',\n  'What does this chart show?'\n);\nconsole.log('Initial analysis:', initial);\n\nconst followup = await session.followUp('What are the key trends?');\nconsole.log('Follow-up:', followup);\n```\n\n### Image Classification and Tagging\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nasync function classifyImage(imageUrl) {\n  const zai = await ZAI.create();\n\n  const prompt = `Analyze this image and provide:\n1. Main subject\u002Fcategory\n2. Key objects detected\n3. Scene description\n4. Suggested tags (comma-separated)\n\nFormat your response as JSON.`;\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: [\n          {\n            type: 'text',\n            text: prompt\n          },\n          {\n            type: 'image_url',\n            image_url: { url: imageUrl }\n          }\n        ]\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  const content = response.choices[0]?.message?.content;\n  \n  try {\n    return JSON.parse(content);\n  } catch (e) {\n    return { rawResponse: content };\n  }\n}\n```\n\n### OCR and Text Extraction\n\n```javascript\nimport ZAI from 'z-ai-web-dev-sdk';\n\nasync function extractText(imageUrl) {\n  const zai = await ZAI.create();\n\n  const response = await zai.chat.completions.createVision({\n    messages: [\n      {\n        role: 'user',\n        content: [\n          {\n            type: 'text',\n            text: 'Extract all text from this image. Preserve the layout and formatting as much as possible.'\n          },\n          {\n            type: 'image_url',\n            image_url: { url: imageUrl }\n          }\n        ]\n      }\n    ],\n    thinking: { type: 'disabled' }\n  });\n\n  return response.choices[0]?.message?.content;\n}\n```\n\n## Best Practices\n\n### 1. Image Quality and Size\n- Use high-quality images for better analysis results\n- Optimize image size to balance quality and processing speed\n- Supported formats: JPEG, PNG, WebP\n\n### 2. Prompt Engineering\n- Be specific about what information you need from the image\n- Structure complex requests with numbered lists or bullet points\n- Provide context about the image type (photo, diagram, chart, etc.)\n\n### 3. Error Handling\n```javascript\nasync function safeVisionChat(imageUrl, question) {\n  try {\n    const zai = await ZAI.create();\n    \n    const response = await zai.chat.completions.createVision({\n      messages: [\n        {\n          role: 'user',\n          content: [\n            { type: 'text', text: question },\n            { type: 'image_url', image_url: { url: imageUrl } }\n          ]\n        }\n      ],\n      thinking: { type: 'disabled' }\n    });\n\n    return {\n      success: true,\n      content: response.choices[0]?.message?.content\n    };\n  } catch (error) {\n    console.error('Vision chat error:', error);\n    return {\n      success: false,\n      error: error.message\n    };\n  }\n}\n```\n\n### 4. Performance Optimization\n- Cache SDK instance creation when processing multiple images\n- Use appropriate image formats (JPEG for photos, PNG for diagrams)\n- Consider image preprocessing for large batches\n\n### 5. Security Considerations\n- Validate image URLs before processing\n- Sanitize user-provided image data\n- Implement rate limiting for public-facing APIs\n- Never expose SDK credentials in client-side code\n\n## Common Use Cases\n\n1. **Product Analysis**: Analyze product images for e-commerce applications\n2. **Document Understanding**: Extract information from receipts, invoices, forms\n3. **Medical Imaging**: Assist in preliminary analysis (with appropriate disclaimers)\n4. **Quality Control**: Detect defects or anomalies in manufacturing\n5. **Content Moderation**: Analyze images for policy compliance\n6. **Accessibility**: Generate alt text for images automatically\n7. **Visual Search**: Understand and categorize images for search functionality\n\n## Integration Examples\n\n### Express.js API Endpoint\n\n```javascript\nimport express from 'express';\nimport ZAI from 'z-ai-web-dev-sdk';\n\nconst app = express();\napp.use(express.json());\n\nlet zaiInstance;\n\n\u002F\u002F Initialize SDK once\nasync function initZAI() {\n  zaiInstance = await ZAI.create();\n}\n\napp.post('\u002Fapi\u002Fanalyze-image', async (req, res) => {\n  try {\n    const { imageUrl, question } = req.body;\n\n    if (!imageUrl || !question) {\n      return res.status(400).json({ \n        error: 'imageUrl and question are required' \n      });\n    }\n\n    const response = await zaiInstance.chat.completions.createVision({\n      messages: [\n        {\n          role: 'user',\n          content: [\n            { type: 'text', text: question },\n            { type: 'image_url', image_url: { url: imageUrl } }\n          ]\n        }\n      ],\n      thinking: { type: 'disabled' }\n    });\n\n    res.json({\n      success: true,\n      analysis: response.choices[0]?.message?.content\n    });\n  } catch (error) {\n    res.status(500).json({\n      success: false,\n      error: error.message\n    });\n  }\n});\n\ninitZAI().then(() => {\n  app.listen(3000, () => {\n    console.log('Vision chat API running on port 3000');\n  });\n});\n```\n\n## Troubleshooting\n\n**Issue**: \"SDK must be used in backend\"\n- **Solution**: Ensure z-ai-web-dev-sdk is only imported and used in server-side code\n\n**Issue**: Image not loading or being analyzed\n- **Solution**: Verify the image URL is accessible and returns a valid image format\n\n**Issue**: Poor analysis quality\n- **Solution**: Provide more specific prompts and ensure image quality is sufficient\n\n**Issue**: Slow response times\n- **Solution**: Optimize image size and consider caching frequently analyzed images\n\n## Remember\n\n- Always use z-ai-web-dev-sdk in backend code only\n- The SDK is already installed - import as shown in examples\n- Structure prompts clearly for best results\n- Handle errors gracefully in production applications\n- Consider user privacy when processing images\n",{"name":5,"license":14,"description":7},"main","e3fd17b8fbda2bd94b990bc6f9d36baa4799d916","skills\u002FVLM","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map","https:\u002F\u002Fgithub.com\u002Fnordeim","A freelance IT engineer","2026-09-29 14:48:51",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add nordeim\u002Factivity-map --skill VLM",{"tool":37,"command":38},"bunx","bunx skills add nordeim\u002Factivity-map --skill VLM",{"tool":40,"command":41},"pnpm","pnpm dlx skills add nordeim\u002Factivity-map --skill VLM","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002FVLM\u002FSKILL.md",true,[45,50],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":15},"LICENSE.txt","LICENSE","许可证",1080,{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"scripts\u002Fvlm.ts","SCRIPT","脚本",1431,"https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002FVLM\u002Fscripts\u002Fvlm.ts",[57,66,74,82,89,97],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":61,"licenseFileUrl":62,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7DC1S8HA1BK68JJ3X0RB6Q7","webapp-testing","Web application testing principles. E2E, Playwright, deep audit strategies.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":70,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7DBZ6CNDP7931Q6ARNW2FPY","web-search","Implement web search capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to search for real-time information from the web, retrieve up-to-date content beyond the knowledge cutoff, or find the latest news and data. Returns structured search results with URLs, snippets, and metadata.","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fweb-search\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fweb-search\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":78,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7DBXYJ0FZDEY7RCVQ1JGGYJ","web-reader","Implement web page content extraction capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to scrape web pages, extract article content, retrieve page metadata, or build applications that process web content. Supports automatic content extraction with title, HTML, and publication time retrieval.","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fweb-reader\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fweb-reader\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7DBXQCCSKMVSBEEQYSHZ1NR","web-frameworks","Build modern full-stack web applications with Next.js 16 + React 19 (App Router, Server Components, RSC, PPR, cacheComponents, async params, SSR, SSG, ISR, standalone output), Turborepo (monorepo, task pipelines, remote caching, parallel execution), and RemixIcon (3100+ SVG icons). Use when creating React applications, implementing server-side rendering, setting up monorepos, optimizing build performance and caching, or working with TypeScript full-stack projects.","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fweb-frameworks\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7DBSB6CJZHACRPPEAD8CVF4","video-understand","Implement specialized video understanding capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze video content, understand motion and temporal sequences, extract information from video frames, describe video scenes, or perform video-based AI analysis. Optimized for MP4, AVI, MOV, and other common video formats.","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-understand\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-understand\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":101,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M7DBS2WBW9K51J64BHVWQNMY","video-generation","Implement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or images, create video content programmatically, or build applications that produce video outputs. Supports asynchronous task management with status polling and result retrieval.","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-generation\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fnordeim\u002Factivity-map\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-generation\u002FSKILL.md",[],[]]