Image Analysis
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
contents | array | ✅ Yes | - | Contains the content to be analyzed, including text and image references. |
role | string | ✅ Yes | - | The role of the message sender (e.g., “user”). |
parts | array | ✅ Yes | - | Parts of the content, can include text and image data. |
text | string | ✅ Yes | - | The text prompt for the image analysis. |
inlineData | object | ✅ Yes | - | The inline image data to be analyzed. |
mimeType | string | ✅ Yes | - | The MIME type of the image (e.g., “image/jpeg”). |
data | string | ✅ Yes | - | The base64-encoded image data. |
generationConfig | object | ❌ No | - | Generation configuration settings. |
temperature | number | ❌ No | 0.3 | Controls randomness in the response (0.0 to 1.0). |
safetySettings | array | ❌ No | - | Safety settings for content filtering. |
category | string | ✅ Yes | - | The harm category to filter. |
threshold | string | ✅ Yes | - | The threshold for blocking content (e.g., “BLOCK_MEDIUM_AND_ABOVE”). |