Overview
The Vision Actions module provides AI-powered image analysis for industrial parts and equipment using Google’s Gemini Vision model. It identifies, classifies, and evaluates the physical condition of items in images.analyzePartImage
Analyzes an image of an industrial part or equipment using Gemini Vision to extract structured information including type, condition, brand, model, and recommendations.Parameters
Response
Structured analysis result from the AI model
Whether the analysis succeeded
Error message if analysis failed
PartAnalysisResult Schema
General classification of the item
Visible identification code on the part
Detailed description of the part or equipment
Manufacturer brand if visible
Equipment model if visible
Number of parts of this type detected in the image
Visual condition of the part
Brief recommendation for handling or maintenance
AI’s confidence level in the identification
Features
- Size Validation: Enforces maximum image size (configured in
MAX_IMAGE_SIZE_MB) - Structured Output: Uses Zod schema validation for consistent results
- Low Temperature: Uses temperature 0.1 for strict schema adherence
- Detailed Analysis: Extracts multiple attributes including condition and recommendations
Example
Example Response
Configuration
Environment Variables
GOOGLE_GENERATIVE_AI_API_KEY: Required for vision analysisMAX_IMAGE_SIZE_MB: Maximum image file size (defined inconfig/limits)
Constants
INVENTORY_PROMPT: Default prompt for inventory analysis (defined inconfig)
Model Configuration
- Model:
gemini-2.5-flash - Temperature: 0.1 (low temperature for consistent structured output)
- Schema: Zod validation for type-safe results
Supported Image Formats
The function accepts standard image formats including:- JPEG/JPG
- PNG
- WebP
- GIF
Size Limits
Images are validated againstMAX_IMAGE_SIZE_MB before processing. Large images are rejected with a descriptive error message.
Use Cases
- Inventory Management: Automatically catalog parts with descriptions and codes
- Quality Inspection: Assess physical condition of equipment
- Maintenance Planning: Get AI-powered recommendations for part handling
- Asset Tracking: Detect quantities and identify brands/models
- Documentation: Generate structured records from visual inspections